提交 2eeac816 authored 作者: blu's avatar blu

dingbot

上级 37cd4f1a
...@@ -12,6 +12,7 @@ from models import Terminal ...@@ -12,6 +12,7 @@ from models import Terminal
import paho.mqtt.client as mqtt import paho.mqtt.client as mqtt
import logging import logging
import pdb, traceback, sys, socket import pdb, traceback, sys, socket
import time
logger = logging.getLogger(__file__) logger = logging.getLogger(__file__)
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
...@@ -81,6 +82,7 @@ class DingBot: ...@@ -81,6 +82,7 @@ class DingBot:
try: try:
jd = json.loads(payload) jd = json.loads(payload)
userdata.handle(jd) userdata.handle(jd)
time.sleep(1);
except Exception as e: except Exception as e:
logger.error('exception in process message: {}'.format(e)) logger.error('exception in process message: {}'.format(e))
#extype, value, tb = sys.exc_info() #extype, value, tb = sys.exc_info()
......
...@@ -1482,9 +1482,15 @@ public: ...@@ -1482,9 +1482,15 @@ public:
if(!sn.empty() && sn != "all") { if(!sn.empty() && sn != "all") {
lock_guard<recursive_mutex> lg(mutIpcStatus); lock_guard<recursive_mutex> lg(mutIpcStatus);
if(this->peerData["ipcStatus"].count(sn) != 0) { if(this->peerData["ipcStatus"].count(sn) != 0) {
json j; auto ipcStatus = this->peerData["ipcStatus"][sn];
j[sn] = this->peerData["ipcStatus"][sn]; auto r = buildIssuesForIpc(sn, ipcStatus);
detail = j; if(r.size() > 0){
detail["issues"] = r;
}
detail["current"]= ipcStatus["current"];
detail["expected"] = ipcStatus["expected"];
detail["lastNReports"] = ipcStatus["lastNReports"];
detail["mgrTerminal"] = ipcStatus["mgrTerminal"];
} }
else { else {
ret["msg"] = "ipc not found"; ret["msg"] = "ipc not found";
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论