From f15c4fc708aa2284d2e3a71b4fda073fe78184ae Mon Sep 17 00:00:00 2001 From: Joel Falknau Date: Sat, 24 May 2025 15:52:48 +1000 Subject: [PATCH] keep on demand for pipeline reasons --- allianceauth/eveonline/providers.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/allianceauth/eveonline/providers.py b/allianceauth/eveonline/providers.py index dcb92c44..201db860 100644 --- a/allianceauth/eveonline/providers.py +++ b/allianceauth/eveonline/providers.py @@ -181,6 +181,25 @@ class EveSwaggerProvider(EveProvider): self.adapter = adapter or self self._faction_list = None # what are the odds this will change? could cache forever! + if settings.DEBUG or StartupCommand().is_management_command: + self._client = None + logger.info('ESI client will be loaded on-demand') + else: + logger.info('Loading ESI client') + try: + self._client = esi_client_factory( + token=self._token, + ua_appname=__title__, + ua_version=__version__, + ua_url=__url__, + ) + except (HTTPError, RefResolutionError): + logger.exception( + 'Failed to load ESI client on startup. ' + 'Switching to on-demand loading for ESI client.' + ) + self._client = None + @property def client(self) -> SwaggerClient: if self._client is None: