Skip to content

Commit

Permalink
fix: config
Browse files Browse the repository at this point in the history
  • Loading branch information
icey-yu committed Dec 25, 2024
1 parent 59cbabe commit bc09ca0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/msggateway/ws_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,17 @@ 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")
}
close(shutdownDone)
return nil
}
log.ZError(context.Background(), "NJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ", nil)
etcd.RegisterShutDown(shutDown)
defer cancel()
var err error
select {
case err = <-done:
Expand Down

0 comments on commit bc09ca0

Please sign in to comment.