mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
use same style for AppNotReady Exception
This commit is contained in:
parent
fe65f92df0
commit
9d12a7172c
@ -38,7 +38,7 @@ class InvenTreeConfig(AppConfig):
|
||||
|
||||
try:
|
||||
from django_q.models import Schedule
|
||||
except (AppRegistryNotReady):
|
||||
except AppRegistryNotReady: # pragma: no cover
|
||||
return
|
||||
|
||||
# Remove any existing obsolete tasks
|
||||
@ -48,7 +48,7 @@ class InvenTreeConfig(AppConfig):
|
||||
|
||||
try:
|
||||
from django_q.models import Schedule
|
||||
except (AppRegistryNotReady):
|
||||
except AppRegistryNotReady: # pragma: no cover
|
||||
return
|
||||
|
||||
logger.info("Starting background tasks...")
|
||||
|
@ -28,7 +28,7 @@ def schedule_task(taskname, **kwargs):
|
||||
|
||||
try:
|
||||
from django_q.models import Schedule
|
||||
except (AppRegistryNotReady):
|
||||
except AppRegistryNotReady: # pragma: no cover
|
||||
logger.info("Could not start background tasks - App registry not ready")
|
||||
return
|
||||
|
||||
@ -108,7 +108,7 @@ def offload_task(taskname, *args, force_sync=False, **kwargs):
|
||||
# Workers are not running: run it as synchronous task
|
||||
_func(*args, **kwargs)
|
||||
|
||||
except (AppRegistryNotReady):
|
||||
except AppRegistryNotReady: # pragma: no cover
|
||||
logger.warning(f"Could not offload task '{taskname}' - app registry not ready")
|
||||
return
|
||||
except (OperationalError, ProgrammingError):
|
||||
|
Loading…
Reference in New Issue
Block a user