Skip to content

Commit

Permalink
don't raise KeyError when cleaning up futures
Browse files Browse the repository at this point in the history
  • Loading branch information
ungarj committed Mar 9, 2022
1 parent 95bffc6 commit 67b6f89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mapchete/_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ def _finished_future(self, future, result=None, _dask=False):
Release future from cluster explicitly and wrap result around FinishedFuture object.
"""
if not _dask:
self.running_futures.remove(future)
try:
self.running_futures.remove(future)
except KeyError: # pragma: no cover
pass
self.finished_futures.discard(future)
fut_exception = future.exception(timeout=FUTURE_TIMEOUT)
if fut_exception: # pragma: no cover
Expand Down

0 comments on commit 67b6f89

Please sign in to comment.