fix: [crawler] fix reload_crawlers_stats queues stats

This commit is contained in:
terrtia 2024-12-16 10:59:17 +01:00
parent 5b5ee502d0
commit 3faea7997c
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -1101,8 +1101,14 @@ def reload_crawlers_stats():
tasks = r_crawler.smembers(f'crawler:queue:type:{domain_type}') tasks = r_crawler.smembers(f'crawler:queue:type:{domain_type}')
for task_uuid in tasks: for task_uuid in tasks:
task = CrawlerTask(task_uuid) task = CrawlerTask(task_uuid)
if not task.is_in_queue() and task.get_status() is None and not task.get_capture(): if not task.is_in_queue() and task.get_status() is None:
task.delete() capture = task.get_capture()
if capture:
c = CrawlerCapture(capture)
if not c.exists():
task.delete()
else:
task.delete()
#### Blocklist #### #### Blocklist ####