forked from MarseyWorld/MarseyWorld
add manual flag to cron
parent
da150f7a2a
commit
7b4b541c4c
|
@ -32,7 +32,7 @@ from files.cli import app, db_session, g
|
|||
|
||||
CRON_CACHE_TIMEOUT = 172800
|
||||
|
||||
def cron_fn(every_5m, every_1d, every_1mo, every_2mo):
|
||||
def cron_fn(every_5m, every_1d, every_1mo, every_2mo, manual):
|
||||
with app.app_context():
|
||||
g.db = db_session()
|
||||
g.v = None
|
||||
|
@ -133,6 +133,7 @@ def cron_fn(every_5m, every_1d, every_1mo, every_2mo):
|
|||
@click.option('--every-1d', is_flag=True, help='Call every 1 day.')
|
||||
@click.option('--every-1mo', is_flag=True, help='Call every 1 month.')
|
||||
@click.option('--every-2mo', is_flag=True, help='Call every 2 months.')
|
||||
@click.option('--manual', is_flag=True, help='Call manually.')
|
||||
def cron(**kwargs):
|
||||
cron_fn(**kwargs)
|
||||
|
||||
|
|
|
@ -60,4 +60,4 @@ if IS_LOCALHOST:
|
|||
if "cron" not in argv and "load_chat" not in argv:
|
||||
from files.helpers.cron import cron_fn
|
||||
print('Starting cron tasks!', flush=True)
|
||||
gevent.spawn(cron_fn, True, False, False, False)
|
||||
gevent.spawn(cron_fn, True, False, False, False, False)
|
||||
|
|
Loading…
Reference in New Issue