fix: config

pull/2997/head
icey-yu 9 months ago
parent 5fd409dae4
commit 59cbabed8e

@ -4,12 +4,13 @@ import (
"context"
"errors"
"fmt"
"github.com/openimsdk/open-im-server/v3/pkg/rpcli"
"net/http"
"sync"
"sync/atomic"
"time"
"github.com/openimsdk/open-im-server/v3/pkg/rpcli"
"github.com/openimsdk/open-im-server/v3/pkg/common/discovery/etcd"
"github.com/openimsdk/open-im-server/v3/pkg/common/webhook"
"github.com/openimsdk/open-im-server/v3/pkg/rpccache"
@ -189,8 +190,9 @@ func (ws *WsServer) Run(done chan error) error {
netErr = errs.WrapMsg(err, "ws start err", server.Addr)
}
}()
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
shutDown := func() error {
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
sErr := server.Shutdown(ctx)
if sErr != nil {
return errs.WrapMsg(sErr, "shutdown err")
@ -198,8 +200,8 @@ func (ws *WsServer) Run(done chan error) error {
close(shutdownDone)
return nil
}
log.ZError(context.Background(), "NJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ", nil)
etcd.RegisterShutDown(shutDown)
defer cancel()
var err error
select {
case err = <-done:

Loading…
Cancel
Save