Skip to content

Commit

Permalink
Attempting to shut down the work queue early. RE:natcap#360
Browse files Browse the repository at this point in the history
  • Loading branch information
phargogh committed Oct 10, 2024
1 parent 945ad09 commit 430956b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pygeoprocessing/geoprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3299,6 +3299,13 @@ def _fill_work_queue():
worker.join(max_timeout)
break
except queue.Empty:
# Shut down the worker thread.
# The work queue only has 10 items in it at a time, so it's pretty
# likely that we can preemptively shut it down by adding a ``None``
# here and then have the queue not take too much longer to quit.
work_queue.put(None)

# Close thread-local raster objects
signal_raster = signal_band = None
target_raster = target_band = None
mask_raster = mask_band = None
Expand Down

0 comments on commit 430956b

Please sign in to comment.