From a04c42098c617de28105f5c787462021fe1fdad3 Mon Sep 17 00:00:00 2001 From: vladsaveliev Date: Thu, 28 Mar 2024 00:26:07 +0100 Subject: [PATCH] repeated job doesnt take background task --- app/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 30a4262..acd5a6e 100644 --- a/app/main.py +++ b/app/main.py @@ -323,11 +323,11 @@ def _update_download_stats(): wait_first=True, logger=logger, ) -async def update_downloads(background_tasks: BackgroundTasks): +async def update_downloads(): """ Repeated task to update the daily download statistics. """ - background_tasks.add_task(_update_download_stats) + _update_download_stats() @app.post("/persist_visits")