def send_ws(self,event):
try:
_data = json.dumps(event.dict_,ensure_ascii=False)
_l = cache['msg']+[_data]
cache['msg'] = _l[-1*cache['len']:]
if event.type_ == EVENT_LOG:
print(event.dict_['log'])
logger.error(event.dict_['log'])
elif event.type_ == EVENT_REBOOT:
reboot_ctp({})
for _ws in cs:
_ws.send(_data)
except Exception,e:
print('ws.send_ws.error,',str(e))
finally:
pass
评论列表
文章目录