fix: [crawlers] fix errored capture queue

This commit is contained in:
terrtia 2024-01-30 11:29:42 +01:00
parent fbd7e2236a
commit d1608e89e1
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -142,6 +142,12 @@ class Crawler(AbstractModule):
return capture
elif status == crawlers.CaptureStatus.UNKNOWN:
capture_start = capture.get_start_time(r_str=False)
if capture_start == 0:
task = capture.get_task()
task.delete()
capture.delete()
self.logger.warning(f'capture UNKNOWN ERROR STATE, {task.uuid} Removed from queue')
return None
if int(time.time()) - capture_start > 600: # TODO ADD in new crawler config
task = capture.get_task()
task.reset()