Skip to content

Commit

Permalink
Update plugin.py: make callback async
Browse files Browse the repository at this point in the history
  • Loading branch information
pfackeldey authored Nov 1, 2024
1 parent acb073b commit 76d599a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion coffea_casa/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from distributed.compatibility import PeriodicCallback
from distributed.diagnostics.plugin import NannyPlugin, WorkerPlugin
from dask.utils import tmpfile, parse_bytes
from distributed.utils import log_errors


logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -178,7 +180,8 @@ def setup(self, worker) -> None:
worker.periodic_callbacks["coffea_casa_gc_collect"] = pc
self.worker = worker

def _gc_collect(self) -> None:
@log_errors
async def _gc_collect(self) -> None:
"""
Trigger garbage collection if the process memory exceeds the threshold.
"""
Expand Down

0 comments on commit 76d599a

Please sign in to comment.