Skip to content

Commit 8692d9b

Browse files
committed
fix: [crawler] crawler queued capture loop
1 parent e6e48c6 commit 8692d9b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

bin/crawlers/Crawler.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ def get_message(self):
166166
else:
167167
capture.update(status)
168168
elif status == crawlers.CaptureStatus.QUEUED:
169-
capture.update(status, delta=30)
170-
print(capture.uuid, crawlers.CaptureStatus(status).name, int(time.time() + 30))
169+
capture.update(status)
170+
print(capture.uuid, crawlers.CaptureStatus(status).name, int(time.time()))
171171
elif status == crawlers.CaptureStatus.ONGOING:
172172
capture.update(status)
173173
print(capture.uuid, crawlers.CaptureStatus(status).name, int(time.time()))

bin/lib/crawlers.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1531,13 +1531,13 @@ def create(self, task_uuid):
15311531
r_crawler.zadd('crawler:captures', {self.uuid: launch_time})
15321532
r_cache.zadd('crawler:captures', {self.uuid: launch_time})
15331533

1534-
def update(self, status, delta=0):
1534+
def update(self, status):
15351535
# Error or Reload
1536-
if not status:
1536+
if status is None:
15371537
r_cache.hset(f'crawler:capture:{self.uuid}', 'status', CaptureStatus.UNKNOWN.value)
15381538
r_cache.zadd('crawler:captures', {self.uuid: 0})
15391539
else:
1540-
last_check = int(time.time() + delta)
1540+
last_check = int(time.time())
15411541
r_cache.hset(f'crawler:capture:{self.uuid}', 'status', status)
15421542
r_cache.zadd('crawler:captures', {self.uuid: last_check})
15431543

0 commit comments

Comments
 (0)