force celery tasks scheduling only in celery mode to avoid putting to much pressure on the backend

This commit is contained in:
ziirish 2019-05-03 14:32:32 +02:00
parent 15be9a6238
commit a426488c24
No known key found for this signature in database
GPG key ID: 72DB229A64B54E46

View file

@ -320,8 +320,9 @@ def create_celery(myapp, warn=True):
# may fail in case redis is not running (this can happen while running
# the bui-manage script)
try:
from .tasks import force_scheduling_now
force_scheduling_now()
if os.getenv('BUI_MODE', '') == 'celery':
from .tasks import force_scheduling_now
force_scheduling_now()
except: # pragma: no cover
pass