add return ok

This commit is contained in:
sergey 2024-10-18 13:01:15 +03:00
parent 40ce559f53
commit 0ce65ab99e
1 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,7 @@ async def net_send_message(
)
if result and result["status"] == 200:
await set_value(f"scom:net:{message.alert_source}", result["msg_id"])
return "ok"
else:
text = (
f"{message.alert_resolution_state} {message.alert_source} is responding"
@ -51,6 +52,7 @@ async def net_send_message(
message_thread_id=conf.tg.net_tred_id,
reply_to_message_id=msg_id,
)
return "ok"
@router.post("/srv")
@ -80,6 +82,7 @@ async def srv_send_message(
f"scom:srv:{message.alert_source}-{message.alert_name}",
result["msg_id"],
)
return "ok"
else:
text = f"{message.alert_source}\nAlert: {message.alert_name}\nState: {message.alert_resolution_state}\nDescription: {message.alert_description}"
dashboard_msg_id = await pop_value(
@ -100,3 +103,4 @@ async def srv_send_message(
message_thread_id=conf.tg.srv_tred_id,
reply_to_message_id=msg_id,
)
return "ok"