From 3acea943f9f4a2d4042d45a83782892c01f47491 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 6 Sep 2023 20:08:24 +0300 Subject: [PATCH] fix cron testing on localhost --- files/routes/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/files/routes/__init__.py b/files/routes/__init__.py index a2a3f1df8..872292efb 100644 --- a/files/routes/__init__.py +++ b/files/routes/__init__.py @@ -52,7 +52,9 @@ if FEATURES['PING_GROUPS']: from .groups import * if IS_LOCALHOST: - from files.helpers.cron import cron_fn - print('Starting cron tasks!', flush=True) - gevent.spawn(cron_fn, True, False) - print('Cron tasks Finished!', flush=True) + from sys import argv + if "cron" not in argv: + from files.helpers.cron import cron_fn + print('Starting cron tasks!', flush=True) + gevent.spawn(cron_fn, True, False) + print('Cron tasks Finished!', flush=True)