From 74d90bb8962d9d1ee63e77accb5ae945bfd8bf82 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Sat, 12 Mar 2022 21:34:00 +0300 Subject: [PATCH] Add cron --- src/core/setup_arq.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/setup_arq.py b/src/core/setup_arq.py index eaa7a09..8756090 100644 --- a/src/core/setup_arq.py +++ b/src/core/setup_arq.py @@ -1,3 +1,5 @@ +from arq.cron import cron + from app.services.cache_updater import ( check_books, cache_file_by_book_id, @@ -24,5 +26,8 @@ class WorkerSettings: on_startup = startup on_shutdown = shutdown redis_settings = get_redis_settings() - max_jobs = 2 + max_jobs = 1 job_timeout = 3 * 60 + cron_jobs = [ + cron("check_books", hour={7}, minute=0) + ]