only print "Cron tasks finished" when they're actually finished

pull/199/head
Aevann 2023-09-14 20:21:46 +03:00
parent 4cafef23fd
commit b029ae2c38
2 changed files with 3 additions and 1 deletions

View File

@ -102,6 +102,9 @@ def cron_fn(every_5m, every_1d, every_fri_12, every_fri_23, every_sat_00, every_
del g.db
stdout.flush()
if IS_LOCALHOST:
print('Cron tasks Finished!', flush=True)
@app.cli.command('cron', help='Run scheduled tasks.')
@click.option('--every-5m', is_flag=True, help='Call every 5 minutes.')
@click.option('--every-1d', is_flag=True, help='Call every 1 day.')

View File

@ -57,4 +57,3 @@ if IS_LOCALHOST:
from files.helpers.cron import cron_fn
print('Starting cron tasks!', flush=True)
gevent.spawn(cron_fn, True, False, False, False, False, False)
print('Cron tasks Finished!', flush=True)