put cron_fn in gevent to make it stop blocking

pull/173/head
Aevann 2023-07-23 00:31:44 +03:00
parent 8bd0429124
commit d0c7524154
2 changed files with 28 additions and 28 deletions

View File

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

View File

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