diff --git a/sources/scraping/__init__.py b/sources/scraping/__init__.py index aa12e92f5..23716b0f8 100644 --- a/sources/scraping/__init__.py +++ b/sources/scraping/__init__.py @@ -44,7 +44,7 @@ def scrapy_resource( try: if queue.is_closed: - raise QueueClosedError + raise QueueClosedError("Queue is closed") result = queue.get(timeout=queue_result_timeout) batch.append(result) diff --git a/sources/scraping/queue.py b/sources/scraping/queue.py index b3baf2aeb..0371b1690 100644 --- a/sources/scraping/queue.py +++ b/sources/scraping/queue.py @@ -27,13 +27,8 @@ def __init__(self, maxsize: int = 0) -> None: self._is_closed = False def close(self) -> None: - with self._state_lock: - if self._is_closed: - return - - self._is_closed = True + self._is_closed = True @property def is_closed(self) -> bool: - with self._state_lock: - return self._is_closed + return self._is_closed