use same style for AppNotReady Exception

This commit is contained in:
Matthias 2022-02-13 17:35:07 +01:00
parent fe65f92df0
commit 9d12a7172c
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 4 additions and 4 deletions

View File

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

View File

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