diff --git a/cron-rdrama.sh b/cron.sh similarity index 64% rename from cron-rdrama.sh rename to cron.sh index fdefb70591..3f78e5dd06 100644 --- a/cron-rdrama.sh +++ b/cron.sh @@ -2,7 +2,10 @@ LOG='/var/log/rdrama/cron.log' -echo -e "\n======================================== $1 === $(date --iso-8601=minutes)" >> "$LOG" +echo -e "\n---------------------------------------- $1 --- $(date --iso-8601=minutes)" >> "$LOG" +source /e source .env /usr/local/bin/flask cron $1 >>"$LOG" 2>&1 + +echo -e "\n======================================== $1 === $(date --iso-8601=minutes)" >> "$LOG" diff --git a/files/helpers/cron.py b/files/helpers/cron.py index af25e8d89e..ce3bf8ad03 100644 --- a/files/helpers/cron.py +++ b/files/helpers/cron.py @@ -1,4 +1,3 @@ -import datetime import time import os from sys import stdout @@ -33,7 +32,6 @@ def cron_fn(every_5m, every_1d): try: if every_5m: - kind = 'every_5m' if FEATURES['GAMBLING']: check_if_end_lottery_task() @@ -42,7 +40,6 @@ def cron_fn(every_5m, every_1d): _award_timers_task() if every_1d: - kind = 'every_1d' stats.generate_charts_task(SITE) _sub_inactive_purge_task() @@ -59,10 +56,6 @@ def cron_fn(every_5m, every_1d): g.db.close() del g.db - - now = datetime.datetime.now().time() - - print(f'Finished {kind} at {now}', flush=True) stdout.flush() @app.cli.command('cron', help='Run scheduled tasks.')