mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 11:09:16 +08:00
fix: 解决容器执行 exit 退出后服务 panic 的问题 (#4922)
This commit is contained in:
parent
d7df881da9
commit
1e192c18e7
@ -70,6 +70,11 @@ func (sws *LocalWsSession) masterWrite(data []byte) error {
|
||||
}
|
||||
|
||||
func (sws *LocalWsSession) receiveWsMsg(exitCh chan bool) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
global.LOG.Errorf("[xpack] A panic occurred during receive ws message, error message: %v", r)
|
||||
}
|
||||
}()
|
||||
wsConn := sws.wsConn
|
||||
defer setQuit(exitCh)
|
||||
defer global.LOG.Debug("thread of receive ws msg has exited now")
|
||||
|
@ -116,6 +116,11 @@ func (sws *LogicSshWsSession) Start(quitChan chan bool) {
|
||||
}
|
||||
|
||||
func (sws *LogicSshWsSession) receiveWsMsg(exitCh chan bool) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
global.LOG.Errorf("[xpack] A panic occurred during receive ws message, error message: %v", r)
|
||||
}
|
||||
}()
|
||||
wsConn := sws.wsConn
|
||||
defer setQuit(exitCh)
|
||||
for {
|
||||
|
Loading…
Reference in New Issue
Block a user