schedule next sync one hour after finish

This commit is contained in:
qananasikq
2026-04-16 20:44:11 +03:00
parent 90f5dff25c
commit 930057b6b9
2 changed files with 54 additions and 13 deletions

View File

@@ -40,17 +40,9 @@ celery_app.conf.update(
},
result_expires=86400,
worker_hijack_root_logger=False,
beat_schedule={
"periodic-encar-sync": {
"task": "encar_scraper.worker.tasks.encar_sync_listing_task",
"schedule": settings.celery.encar_beat_interval_minutes * 60.0,
"args": (),
"kwargs": {
"car_type": "all",
},
"options": {"queue": "encar"},
},
},
# Следующий запуск планирует сама задача в finally через apply_async(countdown=...),
# чтобы час отсчитывался от завершения прогона, а не от старта.
beat_schedule={},
task_routes={
"encar_scraper.worker.tasks.*": {"queue": "encar"},
},