Remove client judgment (#862)

This commit is contained in:
link 2023-02-06 17:10:05 +08:00 committed by GitHub
parent 173997c44b
commit 4c917a33a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 13 deletions

View file

@ -116,14 +116,7 @@ func main() {
// every day execution
err := cron2.AddFunc("0/5 * * * * *", func() {
if service.ClientCount > 0 {
// route.SendNetINfoBySocket()
// route.SendCPUBySocket()
// route.SendMemBySocket()
// route.SendDiskBySocket()
// route.SendUSBBySocket()
route.SendAllHardwareStatusBySocket()
}
route.SendAllHardwareStatusBySocket()
})
if err != nil {
fmt.Println(err)

View file

@ -21,11 +21,6 @@ import (
"gorm.io/gorm"
)
var (
//NotifyMsg chan notify.Message
ClientCount int
)
type NotifyServer interface {
GetLog(id string) model.AppNotify
AddLog(log model.AppNotify)
@ -64,6 +59,7 @@ func (i *notifyServer) SendNotify(name string, message map[string]interface{}) {
response, err := MyService.MessageBus().PublishEventWithResponse(context.Background(), common.SERVICENAME, name, msg)
if err != nil {
logger.Error("failed to publish event to message bus", zap.Error(err), zap.Any("event", msg))
return
}
if response.StatusCode() != http.StatusOK {
logger.Error("failed to publish event to message bus", zap.String("status", response.Status()), zap.Any("response", response))