Skip to content

Commit

Permalink
Check if crawling has already been stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
sultaniman committed Mar 1, 2024
1 parent 2c4fd60 commit 3ae0f1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sources/scraping/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ def on_item_scraped(self, item: Item) -> None:
"Queue is closed, stopping",
extra={"pipeline_name": self.pipeline_name},
)
self.stopping = True
self.crawler.stop()
if not self.stopping:
self.stopping = True
self.crawler.stop()

def on_engine_stopped(self) -> None:
logger.info(f"Crawling engine stopped for pipeline={self.pipeline_name}")
Expand Down

0 comments on commit 3ae0f1e

Please sign in to comment.