Skip to content

Commit

Permalink
Merge pull request #10 from aserper/en_adjusting_for_keep_alive_array
Browse files Browse the repository at this point in the history
accounting for KEEP ALIVE array
  • Loading branch information
aserper committed Apr 2, 2024
2 parents 27a7e8b + 210bc85 commit c6a395f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ def main():
if line.strip():
print(f"Received server event: {line}")
eventData = json.loads(line)
alerts = eventData["alerts"]
# Keepalive check to please CF
if "KEEP_ALIVE" in eventData.get("name", ""):
if "KEEP_ALIVE" in alerts[0].get("name", ""):
print("DEBUG: Received Keep alive")
elif eventData is None:
print("Event is None.")
else:
print("Processing event...")
messageManager.postMessage(eventData["alerts"])
messageManager.postMessage(alerts)
print("Event processed completed successfully.")

except KeyboardInterrupt:
Expand Down

0 comments on commit c6a395f

Please sign in to comment.