fix cli shutdown panic
This commit is contained in:
parent
7fff2f8a1c
commit
b28dbdb8c1
|
@ -210,7 +210,9 @@ func (svr *Server) Shutdown() (err error) {
|
||||||
if !atomic.CompareAndSwapInt32(&svr.exitFlag, 0, 1) {
|
if !atomic.CompareAndSwapInt32(&svr.exitFlag, 0, 1) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if svr.l != nil {
|
||||||
err = svr.l.Close()
|
err = svr.l.Close()
|
||||||
|
}
|
||||||
svr.ctxMap.Range(func(key, value any) bool {
|
svr.ctxMap.Range(func(key, value any) bool {
|
||||||
if ctx, ok := value.(*Context); ok {
|
if ctx, ok := value.(*Context); ok {
|
||||||
err = ctx.Close()
|
err = ctx.Close()
|
||||||
|
|
Loading…
Reference in New Issue