From 863c880b169a788fe74b27187baa2e3f60b72ed2 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期三, 30 十月 2019 15:19:23 +0800
Subject: [PATCH] feat: add reboot
---
service/EnableStatusControlService.go | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/service/EnableStatusControlService.go b/service/EnableStatusControlService.go
index 045f9b9..a0439b1 100644
--- a/service/EnableStatusControlService.go
+++ b/service/EnableStatusControlService.go
@@ -1,7 +1,6 @@
package service
import (
- "basic.com/dbapi.git"
"basic.com/valib/logger.git"
"encoding/json"
"fmt"
@@ -15,14 +14,13 @@
func GetVerificationData() []map[string]interface{} {
localConf, err2 := cache.GetServerInfo()
- if err2 !=nil || localConf.AlarmIp == "" {
+ if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" {
logger.Debug("localConfig is wrong!!!")
return nil
}
url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) +
"/" + config.EsInfo.EsIndex.DbTables.IndexName + "/_search"
- var setApi dbapi.SysSetApi
- _, sysconf := setApi.GetServerInfo()
+
jsonDSL := `{
"query": {
"bool": {
@@ -33,7 +31,7 @@
},
{
"terms": {
- "analyServerId": ["` + sysconf.ServerId + `",""]
+ "analyServerId": ["` + localConf.ServerId + `",""]
}
}
]
@@ -90,7 +88,7 @@
}
enable := strconv.Itoa(status)
localConf, err2 := cache.GetServerInfo()
- if err2 !=nil || localConf.AlarmIp == "" {
+ if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" {
logger.Debug("localConfig is wrong!!!")
return "localConf wrong"
}
--
Gitblit v1.8.0