Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rex Dri
Rex Dri
Commits
ebbff9e8
Commit
ebbff9e8
authored
May 23, 2020
by
Florent Chehab
Committed by
Maxime Emschwiller
May 23, 2020
Browse files
feature(backend): setup cron to get stats daily
parent
acf63fd4
Pipeline
#61398
failed with stages
in 1 minute and 29 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
backend/cron_tasks.py
View file @
ebbff9e8
...
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment