fix: fix SIGTERM error

pull/1885/head
luhaoling 2 years ago
parent 98330159fe
commit 38461f9544

@ -15,7 +15,9 @@
package genutil
import (
"errors"
"fmt"
"github.com/OpenIMSDK/tools/errs"
"os"
"path/filepath"
)
@ -41,6 +43,9 @@ func OutDir(path string) (string, error) {
}
func ExitWithError(err error) {
if errors.Is(errs.Unwrap(err), errors.New("SIGTERM received, shutting down")) {
os.Exit(-1)
}
progName := filepath.Base(os.Args[0])
fmt.Fprintf(os.Stderr, "\n\n%s exit -1: \n%+v\n\n", progName, err)
os.Exit(-1)

Loading…
Cancel
Save