mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
fix: fi the code error
This commit is contained in:
parent
6748b8fb0b
commit
f3b27abc43
@ -119,7 +119,7 @@ func run(port int, proPort int) error {
|
||||
defer cancel()
|
||||
select {
|
||||
case <-sigs:
|
||||
util.SIGUSR1Exit()
|
||||
util.SIGTERMExit()
|
||||
err := server.Shutdown(ctx)
|
||||
if err != nil {
|
||||
return errs.Wrap(err, "shutdown err")
|
||||
|
||||
@ -144,7 +144,7 @@ func (m *MsgTransfer) Start(prometheusPort int) error {
|
||||
signal.Notify(sigs, syscall.SIGTERM)
|
||||
select {
|
||||
case <-sigs:
|
||||
util.SIGUSR1Exit()
|
||||
util.SIGTERMExit()
|
||||
// graceful close kafka client.
|
||||
m.cancel()
|
||||
m.historyCH.historyConsumerGroup.Close()
|
||||
|
||||
@ -140,7 +140,7 @@ func Start(
|
||||
signal.Notify(sigs, syscall.SIGTERM)
|
||||
select {
|
||||
case <-sigs:
|
||||
util.SIGUSR1Exit()
|
||||
util.SIGTERMExit()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
if err := gracefulStopWithCtx(ctx, srv.GracefulStop); err != nil {
|
||||
|
||||
@ -46,7 +46,7 @@ func ExitWithError(err error) {
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
func SIGUSR1Exit() {
|
||||
func SIGTERMExit() {
|
||||
progName := filepath.Base(os.Args[0])
|
||||
fmt.Printf("\n\n%s receive process terminal SIGTERM exit 0\n\n", progName)
|
||||
fmt.Fprintf(os.Stderr, "Warning %s receive process terminal SIGTERM exit 0\n", progName)
|
||||
}
|
||||
|
||||
@ -21,7 +21,6 @@
|
||||
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P)
|
||||
[[ -z ${COMMON_SOURCED} ]] && source "${OPENIM_ROOT}"/scripts/install/common.sh
|
||||
|
||||
openim::util::set_max_fd 200000
|
||||
|
||||
SERVER_NAME="openim-msggateway"
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@
|
||||
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P)
|
||||
[[ -z ${COMMON_SOURCED} ]] && source "${OPENIM_ROOT}"/scripts/install/common.sh
|
||||
|
||||
openim::util::set_max_fd 200000
|
||||
|
||||
SERVER_NAME="openim-msgtransfer"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user