put cron_fn in gevent to make it stop blocking
parent
8bd0429124
commit
d0c7524154
|
@ -27,6 +27,7 @@ from files.cli import app, db_session, g
|
|||
CRON_CACHE_TIMEOUT = 172800
|
||||
|
||||
def cron_fn(every_5m, every_1d):
|
||||
with app.app_context():
|
||||
g.db = db_session()
|
||||
g.v = None
|
||||
|
||||
|
|
|
@ -52,5 +52,4 @@ if FEATURES['PING_GROUPS']:
|
|||
|
||||
if IS_LOCALHOST:
|
||||
from files.helpers.cron import cron_fn
|
||||
with app.app_context():
|
||||
cron_fn(True, False)
|
||||
gevent.spawn(cron_fn, True, False)
|
||||
|
|
Loading…
Reference in New Issue