Skip to content

Commit

Permalink
fix: [crawler] timeout QUEUED captures
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Jan 9, 2025
1 parent 109ce56 commit df161cf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/crawlers/Crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,14 @@ def get_message(self):
else:
capture.update(status)
elif status == crawlers.CaptureStatus.QUEUED:
capture.update(status)
capture_start = capture.get_start_time(r_str=False)
if int(time.time()) - capture_start > 600: # TODO ADD in new crawler config
task = capture.get_task()
task.reset()
capture.delete()
self.logger.warning(f'capture QUEUED Timeout, {task.uuid} Send back in queue')
else:
capture.update(status)
print(capture.uuid, crawlers.CaptureStatus(status).name, int(time.time()))
elif status == crawlers.CaptureStatus.ONGOING:
capture.update(status)
Expand Down

0 comments on commit df161cf

Please sign in to comment.