Skip to content

Commit

Permalink
run cluster widget periodic callbacks on the correct event loop
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed May 25, 2022
1 parent ba39915 commit 2714ca2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions distributed/deploy/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,13 @@ def update():
cluster_repr_interval = parse_timedelta(
dask.config.get("distributed.deploy.cluster-repr-interval", default="ms")
)
pc = PeriodicCallback(update, cluster_repr_interval * 1000)
self.periodic_callbacks["cluster-repr"] = pc
pc.start()

def install():
pc = PeriodicCallback(update, cluster_repr_interval * 1000)
self.periodic_callbacks["cluster-repr"] = pc
pc.start()

self.loop.add_callback(install)
return tab

def _repr_html_(self, cluster_status=None):
Expand Down

0 comments on commit 2714ca2

Please sign in to comment.