Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TimMcCool committed Oct 22, 2024
1 parent 886b8d4 commit 6c31564
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scratchattach/eventhandlers/cloud_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@ def _updater(self):
except Exception:
print("CloudEvents: Disconnected. Reconnecting ...", time.time())
time.sleep(0.1) # cooldown
self.source_cloud.connect()
while True:
try:
self.source_cloud.connect()
except Exception:
print("CloudEvents: Reconnecting failed, trying again in 10 seconds.", time.time())
time.sleep(10)
else:
break

print("CloudEvents: Reconnected.", time.time())
self.call_event("on_reconnect", [])

Expand Down

0 comments on commit 6c31564

Please sign in to comment.