asd
This commit is contained in:
@@ -140,8 +140,11 @@ async def socketio_listener():
|
||||
)
|
||||
if service_row:
|
||||
service_id = service_row['id']
|
||||
except:
|
||||
pass
|
||||
print(f" Found service_id: {service_id} for service: {service_name}")
|
||||
else:
|
||||
print(f" Service {service_name} not found in services table, buttons will use service_name only")
|
||||
except Exception as e:
|
||||
print(f" Error looking up service_id: {e}")
|
||||
|
||||
alert_id = await conn.fetchval("""
|
||||
INSERT INTO attack_alerts (attack_id, alert_type, severity, message)
|
||||
@@ -153,6 +156,8 @@ async def socketio_listener():
|
||||
)
|
||||
RETURNING id
|
||||
""", attack_id, alert_message)
|
||||
|
||||
print(f" Calling send_telegram_alert with service_id={service_id}, service_name={service_name}")
|
||||
await send_telegram_alert(alert_message, service_id=service_id, service_name=service_name)
|
||||
await conn.execute("UPDATE attack_alerts SET notified = true WHERE id = $1", alert_id)
|
||||
print(f" Alert sent successfully")
|
||||
|
||||
Reference in New Issue
Block a user