mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
database not ready events are hard to reproduce consistently
This commit is contained in:
parent
9d12a7172c
commit
ad41957127
@ -47,7 +47,7 @@ def schedule_task(taskname, **kwargs):
|
|||||||
func=taskname,
|
func=taskname,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
except (OperationalError, ProgrammingError):
|
except (OperationalError, ProgrammingError): # pragma: no cover
|
||||||
# Required if the DB is not ready yet
|
# Required if the DB is not ready yet
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ def offload_task(taskname, *args, force_sync=False, **kwargs):
|
|||||||
except AppRegistryNotReady: # pragma: no cover
|
except AppRegistryNotReady: # pragma: no cover
|
||||||
logger.warning(f"Could not offload task '{taskname}' - app registry not ready")
|
logger.warning(f"Could not offload task '{taskname}' - app registry not ready")
|
||||||
return
|
return
|
||||||
except (OperationalError, ProgrammingError):
|
except (OperationalError, ProgrammingError): # pragma: no cover
|
||||||
logger.warning(f"Could not offload task '{taskname}' - database not ready")
|
logger.warning(f"Could not offload task '{taskname}' - database not ready")
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,6 +40,6 @@ class PartConfig(AppConfig):
|
|||||||
item.part.trackable = True
|
item.part.trackable = True
|
||||||
item.part.clean()
|
item.part.clean()
|
||||||
item.part.save()
|
item.part.save()
|
||||||
except (OperationalError, ProgrammingError):
|
except (OperationalError, ProgrammingError): # pragma: no cover
|
||||||
# Exception if the database has not been migrated yet
|
# Exception if the database has not been migrated yet
|
||||||
pass
|
pass
|
||||||
|
@ -51,7 +51,7 @@ class SettingsMixin:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
plugin, _ = PluginConfig.objects.get_or_create(key=self.plugin_slug(), name=self.plugin_name())
|
plugin, _ = PluginConfig.objects.get_or_create(key=self.plugin_slug(), name=self.plugin_name())
|
||||||
except (OperationalError, ProgrammingError):
|
except (OperationalError, ProgrammingError): # pragma: no cover
|
||||||
plugin = None
|
plugin = None
|
||||||
|
|
||||||
if not plugin:
|
if not plugin:
|
||||||
|
@ -102,7 +102,7 @@ class PluginsRegistry:
|
|||||||
self._init_plugins(blocked_plugin)
|
self._init_plugins(blocked_plugin)
|
||||||
self._activate_plugins()
|
self._activate_plugins()
|
||||||
registered_successful = True
|
registered_successful = True
|
||||||
except (OperationalError, ProgrammingError):
|
except (OperationalError, ProgrammingError): # pragma: no cover
|
||||||
# Exception if the database has not been migrated yet
|
# Exception if the database has not been migrated yet
|
||||||
logger.info('Database not accessible while loading plugins')
|
logger.info('Database not accessible while loading plugins')
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user