mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
fix: fix SIGTERM error
This commit is contained in:
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…
x
Reference in New Issue
Block a user