Preserve archive retry limits after an interrupted backfill
GitHub Git mirror / mirror (push) Successful in 6s
Development CI / check-and-build (push) Successful in 1m33s
Development CI / deploy-development (push) Successful in 2m32s

This commit is contained in:
eezd committed 2026-11-05 14:34:40 +08:00
1 parent 93afe4358b
commit a68b1c6e9b
1 file changed
+5
+5
View File
@@ -129,6 +129,11 @@ def main():
finally:
run(*command, 'up', '-d', 'crawler')
for name, task in state['tasks'].items():
if task['status'] == 'running':
task.update(status='retired' if task['attempts'] >= 3 else 'waiting',
next_at=time.time() + 3600,
errors=[{'error': '上次回补中断,保留已用额度并等待冷却'}])
save(path, state)
if task['status'] in ('done', 'retired') or task['next_at'] > time.time():
continue
task['attempts'] += 1