diff --git a/model/monitor.go b/model/monitor.go index 459a036..69c367c 100644 --- a/model/monitor.go +++ b/model/monitor.go @@ -120,7 +120,7 @@ func (m *Monitor) AfterFind(tx *gorm.DB) error { // IsServiceSentinelNeeded 判断该任务类型是否需要进行服务监控 需要则返回true func IsServiceSentinelNeeded(t uint64) bool { - return t != TaskTypeCommand && t != TaskTypeTerminal && t != TaskTypeUpgrade + return t != TaskTypeCommand && t != TaskTypeTerminalGRPC && t != TaskTypeUpgrade } func (m *Monitor) InitSkipServers() error { diff --git a/pkg/websocketx/safe_conn.go b/pkg/websocketx/safe_conn.go index 1d29019..512bddf 100644 --- a/pkg/websocketx/safe_conn.go +++ b/pkg/websocketx/safe_conn.go @@ -28,6 +28,12 @@ func (conn *Conn) Write(data []byte) (int, error) { return len(data), nil } +func (conn *Conn) WriteMessage(messageType int, data []byte) error { + conn.writeLock.Lock() + defer conn.writeLock.Unlock() + return conn.Conn.WriteMessage(messageType, data) +} + func (conn *Conn) Read(data []byte) (int, error) { if len(conn.dataBuf) > 0 { n := copy(data, conn.dataBuf)