Commit ebbff9e8 authored by Florent Chehab's avatar Florent Chehab Committed by Maxime Emschwiller
Browse files

feature(backend): setup cron to get stats daily

parent acf63fd4
Pipeline #61398 failed with stages
in 1 minute and 29 seconds
......@@ -21,6 +21,7 @@ from base_app.management.commands.clean_user_accounts import (
ClearUserAccounts,
ClearSessions,
) # noqa: E402
from stats_app.compute_stats import update_all_stats # noqa: E402
logger = logging.getLogger("django")
......@@ -50,3 +51,9 @@ def update_extra_denormalization(num):
def clear_and_clean_sessions(num):
ClearUserAccounts.run()
ClearSessions.run()
@cron(30, 0, -1, -1, -1, target="spooler") # everyday at 30 past midnight
@harakiri(60 * 5) # shouldn't take more than 5 minutes to run
def update_daily_stats():
update_all_stats()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment