Skip to content

Commit

Permalink
fix: [crawler] avoid crawler loop if a capture end up in an invalid s…
Browse files Browse the repository at this point in the history
…tate
  • Loading branch information
Terrtia committed Dec 9, 2024
1 parent bdb80ee commit ea12a44
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/crawlers/Crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,15 @@ def get_message(self):
self.logger.warning(f'capture UNKNOWN Timeout, {task.uuid} Send back in queue')
else:
capture.update(status)
else:
elif status == crawlers.CaptureStatus.QUEUED or status == crawlers.CaptureStatus.ONGOING:
capture.update(status)
print(capture.uuid, crawlers.CaptureStatus(status).name, int(time.time()))
# Invalid State
else:
task = capture.get_task()
task.reset()
capture.delete()
self.logger.warning(f'ERROR INVALID CAPTURE STATUS {status}, {task.uuid} Send back in queue')

except ConnectionError:
self.logger.warning(f'Lacus ConnectionError, capture {capture.uuid}')
Expand Down

0 comments on commit ea12a44

Please sign in to comment.