forked from rDrama/rDrama
1
0
Fork 0

use the cron file in the repo

master
Aevann 2023-07-23 18:04:52 +03:00
parent d6c250c910
commit b35d3ac183
2 changed files with 4 additions and 8 deletions

View File

@ -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"

View File

@ -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.')