mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	database not ready events are hard to reproduce consistently
This commit is contained in:
		| @@ -47,7 +47,7 @@ def schedule_task(taskname, **kwargs): | ||||
|                 func=taskname, | ||||
|                 **kwargs | ||||
|             ) | ||||
|     except (OperationalError, ProgrammingError): | ||||
|     except (OperationalError, ProgrammingError):  # pragma: no cover | ||||
|         # Required if the DB is not ready yet | ||||
|         pass | ||||
|  | ||||
| @@ -111,7 +111,7 @@ def offload_task(taskname, *args, force_sync=False, **kwargs): | ||||
|     except AppRegistryNotReady:  # pragma: no cover | ||||
|         logger.warning(f"Could not offload task '{taskname}' - app registry not ready") | ||||
|         return | ||||
|     except (OperationalError, ProgrammingError): | ||||
|     except (OperationalError, ProgrammingError):  # pragma: no cover | ||||
|         logger.warning(f"Could not offload task '{taskname}' - database not ready") | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -40,6 +40,6 @@ class PartConfig(AppConfig): | ||||
|                 item.part.trackable = True | ||||
|                 item.part.clean() | ||||
|                 item.part.save() | ||||
|         except (OperationalError, ProgrammingError): | ||||
|         except (OperationalError, ProgrammingError):  # pragma: no cover | ||||
|             # Exception if the database has not been migrated yet | ||||
|             pass | ||||
|   | ||||
| @@ -51,7 +51,7 @@ class SettingsMixin: | ||||
|  | ||||
|         try: | ||||
|             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 | ||||
|  | ||||
|         if not plugin: | ||||
|   | ||||
| @@ -102,7 +102,7 @@ class PluginsRegistry: | ||||
|                 self._init_plugins(blocked_plugin) | ||||
|                 self._activate_plugins() | ||||
|                 registered_successful = True | ||||
|             except (OperationalError, ProgrammingError): | ||||
|             except (OperationalError, ProgrammingError):  # pragma: no cover | ||||
|                 # Exception if the database has not been migrated yet | ||||
|                 logger.info('Database not accessible while loading plugins') | ||||
|                 break | ||||
|   | ||||
		Reference in New Issue
	
	Block a user