Skip to content

Commit

Permalink
Remove INCOMPLETE status. All finished jobs are set to COMPLETED (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgonnav committed May 31, 2023
1 parent 7adea54 commit f166d1f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions estela_scrapy/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

RUNNING_STATUS = "RUNNING"
COMPLETED_STATUS = "COMPLETED"
INCOMPLETE_STATUS = "INCOMPLETE"
FINISHED_REASON = "finished"


class ItemStorageExtension:
Expand Down Expand Up @@ -70,7 +68,7 @@ def item_scraped(self, item):
def spider_closed(self, spider, reason):
spider_stats = self.stats.get_stats()
self.update_job(
status=COMPLETED_STATUS if reason == FINISHED_REASON else INCOMPLETE_STATUS,
status=COMPLETED_STATUS,
lifespan=spider_stats.get("elapsed_time_seconds", 0),
total_bytes=spider_stats.get("downloader/response_bytes", 0),
item_count=spider_stats.get("item_scraped_count", 0),
Expand Down

0 comments on commit f166d1f

Please sign in to comment.