Adding better logging for tasks
This commit is contained in:
@@ -93,7 +93,7 @@ async def handle_message(msg):
|
||||
|
||||
elif event_type == "status":
|
||||
# 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")
|
||||
|
||||
data = {"status": status, "last_seen": timestamp}
|
||||
@@ -167,6 +167,7 @@ async def node_sweeper():
|
||||
print("Starting Node Sweeper...")
|
||||
while True:
|
||||
await asyncio.sleep(60)
|
||||
print("Sweeping nodes...")
|
||||
try:
|
||||
nodes_ref = db.collection("nodes")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user