Adding better logging for tasks

This commit is contained in:
Logan Cusano
2025-12-28 15:11:25 -05:00
parent 8b8c3f7c7a
commit 8b61f5464d

View File

@@ -93,7 +93,7 @@ async def handle_message(msg):
elif event_type == "status": elif event_type == "status":
# Handle explicit Offline messages (LWT or clean shutdown) # Handle explicit Offline messages (LWT or clean shutdown)
print(f"Status update for {node_id}: {payload.get('status')}") print(f"Status update for {node_id}: {payload.get('status')} (Reason: {payload.get('reason', 'unknown')})")
status = payload.get("status") status = payload.get("status")
data = {"status": status, "last_seen": timestamp} data = {"status": status, "last_seen": timestamp}
@@ -167,6 +167,7 @@ async def node_sweeper():
print("Starting Node Sweeper...") print("Starting Node Sweeper...")
while True: while True:
await asyncio.sleep(60) await asyncio.sleep(60)
print("Sweeping nodes...")
try: try:
nodes_ref = db.collection("nodes") nodes_ref = db.collection("nodes")