prison_biz.py增加通知
This commit is contained in:
@@ -429,19 +429,18 @@ class FrameProcessorWorker(threading.Thread):
|
||||
}
|
||||
try:
|
||||
self.ws_queue.put(msg, timeout=1.0)
|
||||
# # if action_names and len(action_names) > 0:
|
||||
# if push_actions and len(push_actions) > 0:
|
||||
# # 发送POST请求
|
||||
# post_msg = msg.copy()
|
||||
# post_msg['type'] = 2
|
||||
# try:
|
||||
# response = requests.post(ALERT_PUSH_URL, json=post_msg, timeout=5.0)
|
||||
# if response.status_code == 200:
|
||||
# print(f"[INFO] POST alert sent successfully for actions: {push_actions}")
|
||||
# else:
|
||||
# print(f"[WARN] POST alert failed with status: {response.status_code}")
|
||||
# except Exception as e:
|
||||
# print(f"[ERROR] POST alert request failed: {e}")
|
||||
if push_actions and len(push_actions) > 0:
|
||||
# 发送POST请求
|
||||
post_msg = msg.copy()
|
||||
post_msg['type'] = 2
|
||||
try:
|
||||
response = requests.post(ALERT_PUSH_URL, json=post_msg, timeout=5.0)
|
||||
if response.status_code == 200:
|
||||
print(f"[INFO] POST alert sent successfully for actions: {push_actions}")
|
||||
else:
|
||||
print(f"[WARN] POST alert failed with status: {response.status_code}")
|
||||
except Exception as e:
|
||||
print(f"[ERROR] POST alert request failed: {e}")
|
||||
except queue.Full:
|
||||
print("[WARN] ws_send_queue full, drop frame message")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user