forked from MarseyWorld/MarseyWorld
use the cron file in the repo
parent
d6c250c910
commit
b35d3ac183
|
@ -2,7 +2,10 @@
|
||||||
|
|
||||||
LOG='/var/log/rdrama/cron.log'
|
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
|
source .env
|
||||||
/usr/local/bin/flask cron $1 >>"$LOG" 2>&1
|
/usr/local/bin/flask cron $1 >>"$LOG" 2>&1
|
||||||
|
|
||||||
|
echo -e "\n======================================== $1 === $(date --iso-8601=minutes)" >> "$LOG"
|
|
@ -1,4 +1,3 @@
|
||||||
import datetime
|
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
from sys import stdout
|
from sys import stdout
|
||||||
|
@ -33,7 +32,6 @@ def cron_fn(every_5m, every_1d):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if every_5m:
|
if every_5m:
|
||||||
kind = 'every_5m'
|
|
||||||
if FEATURES['GAMBLING']:
|
if FEATURES['GAMBLING']:
|
||||||
check_if_end_lottery_task()
|
check_if_end_lottery_task()
|
||||||
|
|
||||||
|
@ -42,7 +40,6 @@ def cron_fn(every_5m, every_1d):
|
||||||
_award_timers_task()
|
_award_timers_task()
|
||||||
|
|
||||||
if every_1d:
|
if every_1d:
|
||||||
kind = 'every_1d'
|
|
||||||
stats.generate_charts_task(SITE)
|
stats.generate_charts_task(SITE)
|
||||||
|
|
||||||
_sub_inactive_purge_task()
|
_sub_inactive_purge_task()
|
||||||
|
@ -59,10 +56,6 @@ def cron_fn(every_5m, every_1d):
|
||||||
|
|
||||||
g.db.close()
|
g.db.close()
|
||||||
del g.db
|
del g.db
|
||||||
|
|
||||||
now = datetime.datetime.now().time()
|
|
||||||
|
|
||||||
print(f'Finished {kind} at {now}', flush=True)
|
|
||||||
stdout.flush()
|
stdout.flush()
|
||||||
|
|
||||||
@app.cli.command('cron', help='Run scheduled tasks.')
|
@app.cli.command('cron', help='Run scheduled tasks.')
|
||||||
|
|
Loading…
Reference in New Issue