mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-24 23:04:40 +08:00
fix: 解决容器执行 exit 退出后服务 panic 的问题 (#4922)
This commit is contained in:
parent
d7df881da9
commit
1e192c18e7
2 changed files with 10 additions and 0 deletions
|
@ -70,6 +70,11 @@ func (sws *LocalWsSession) masterWrite(data []byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sws *LocalWsSession) receiveWsMsg(exitCh chan bool) {
|
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
|
wsConn := sws.wsConn
|
||||||
defer setQuit(exitCh)
|
defer setQuit(exitCh)
|
||||||
defer global.LOG.Debug("thread of receive ws msg has exited now")
|
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) {
|
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
|
wsConn := sws.wsConn
|
||||||
defer setQuit(exitCh)
|
defer setQuit(exitCh)
|
||||||
for {
|
for {
|
||||||
|
|
Loading…
Reference in a new issue