mirror of
https://github.com/ail-project/ail-framework.git
synced 2025-01-18 16:36:13 +00:00
fix: [crawler] avoid crawler loop if a capture end up in an invalid state
This commit is contained in:
parent
bdb80ee4a4
commit
ea12a44836
1 changed files with 7 additions and 1 deletions
|
@ -164,9 +164,15 @@ class Crawler(AbstractModule):
|
||||||
self.logger.warning(f'capture UNKNOWN Timeout, {task.uuid} Send back in queue')
|
self.logger.warning(f'capture UNKNOWN Timeout, {task.uuid} Send back in queue')
|
||||||
else:
|
else:
|
||||||
capture.update(status)
|
capture.update(status)
|
||||||
else:
|
elif status == crawlers.CaptureStatus.QUEUED or status == crawlers.CaptureStatus.ONGOING:
|
||||||
capture.update(status)
|
capture.update(status)
|
||||||
print(capture.uuid, crawlers.CaptureStatus(status).name, int(time.time()))
|
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:
|
except ConnectionError:
|
||||||
self.logger.warning(f'Lacus ConnectionError, capture {capture.uuid}')
|
self.logger.warning(f'Lacus ConnectionError, capture {capture.uuid}')
|
||||||
|
|
Loading…
Add table
Reference in a new issue