From 46046f894c874b325e9ca3291b9b61bae70a117a Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Tue, 27 Aug 2024 22:17:28 +0200 Subject: [PATCH] snappea foreman comment clarifications --- snappea/foreman.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snappea/foreman.py b/snappea/foreman.py index 8b73831..2edd04b 100644 --- a/snappea/foreman.py +++ b/snappea/foreman.py @@ -257,7 +257,7 @@ class Foreman: with contextlib.suppress(FileNotFoundError): os.unlink(os.path.join(self.settings.WAKEUP_CALLS_DIR, event.name)) - self.check_for_stopping() # always check after .read() + self.check_for_stopping() # check after .read() - it may have unblocked via handle_signal() while self.create_workers() == self.settings.TASK_QS_LIMIT: pass # `== TASK_QS_LIMIT`: as documented above @@ -297,7 +297,7 @@ class Foreman: logger.debug("Create workers: Checking (maybe waiting) for available worker slots") self.worker_semaphore.acquire() logger.debug("Create workers: Worker slot available") - self.check_for_stopping() # always check after .acquire() + self.check_for_stopping() # check after .acquire() - it may have unblocked via handle_signal() task_id = task.id try: