diff --git a/bin/crawlers/Crawler.py b/bin/crawlers/Crawler.py index e0890443..0ae89121 100755 --- a/bin/crawlers/Crawler.py +++ b/bin/crawlers/Crawler.py @@ -166,8 +166,8 @@ class Crawler(AbstractModule): else: capture.update(status) elif status == crawlers.CaptureStatus.QUEUED: - capture.update(status, delta=30) - print(capture.uuid, crawlers.CaptureStatus(status).name, int(time.time() + 30)) + capture.update(status) + print(capture.uuid, crawlers.CaptureStatus(status).name, int(time.time())) elif status == crawlers.CaptureStatus.ONGOING: capture.update(status) print(capture.uuid, crawlers.CaptureStatus(status).name, int(time.time())) diff --git a/bin/lib/crawlers.py b/bin/lib/crawlers.py index eac5c8b0..25ee40bd 100755 --- a/bin/lib/crawlers.py +++ b/bin/lib/crawlers.py @@ -1531,13 +1531,13 @@ class CrawlerCapture: r_crawler.zadd('crawler:captures', {self.uuid: launch_time}) r_cache.zadd('crawler:captures', {self.uuid: launch_time}) - def update(self, status, delta=0): + def update(self, status): # Error or Reload - if not status: + if status is None: r_cache.hset(f'crawler:capture:{self.uuid}', 'status', CaptureStatus.UNKNOWN.value) r_cache.zadd('crawler:captures', {self.uuid: 0}) else: - last_check = int(time.time() + delta) + last_check = int(time.time()) r_cache.hset(f'crawler:capture:{self.uuid}', 'status', status) r_cache.zadd('crawler:captures', {self.uuid: last_check})