#96 implement exponential backoff

This commit is contained in:
Henning Jacobs
2017-01-15 16:37:12 +01:00
parent c811281d2a
commit a60f1b58b3
3 changed files with 132 additions and 1 deletions

View File

@@ -89,7 +89,8 @@ def event(cluster_ids: set):
for cluster_id in (app.store.get('cluster-ids') or []):
if not cluster_ids or cluster_id in cluster_ids:
cluster = app.store.get(cluster_id)
yield 'event: clusterupdate\ndata: ' + json.dumps(cluster, separators=(',', ':')) + '\n\n'
if cluster:
yield 'event: clusterupdate\ndata: ' + json.dumps(cluster, separators=(',', ':')) + '\n\n'
while True:
for event_type, event_data in app.store.listen():
# hacky, event_data can be delta or full cluster object