fix: Fix the problem that services exit unexpectedly when the contain… (#8127)
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after -22s

This commit is contained in:
ssongliu 2025-03-12 11:19:03 +08:00 committed by GitHub
parent 51fe02661f
commit 5610c73d67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,6 +53,11 @@ func (sws *LocalWsSession) handleSlaveEvent(exitCh chan bool) {
}
func (sws *LocalWsSession) masterWrite(data []byte) error {
defer func() {
if r := recover(); r != nil {
global.LOG.Errorf("A panic occurred during write ws message to master, error message: %v", r)
}
}()
sws.writeMutex.Lock()
defer sws.writeMutex.Unlock()
wsData, err := json.Marshal(WsMsg{