Skip to content

Commit 3faea79

Browse files
committed
fix: [crawler] fix reload_crawlers_stats queues stats
1 parent 5b5ee50 commit 3faea79

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bin/lib/crawlers.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,8 +1101,14 @@ def reload_crawlers_stats():
11011101
tasks = r_crawler.smembers(f'crawler:queue:type:{domain_type}')
11021102
for task_uuid in tasks:
11031103
task = CrawlerTask(task_uuid)
1104-
if not task.is_in_queue() and task.get_status() is None and not task.get_capture():
1105-
task.delete()
1104+
if not task.is_in_queue() and task.get_status() is None:
1105+
capture = task.get_capture()
1106+
if capture:
1107+
c = CrawlerCapture(capture)
1108+
if not c.exists():
1109+
task.delete()
1110+
else:
1111+
task.delete()
11061112

11071113
#### Blocklist ####
11081114

0 commit comments

Comments
 (0)