keep on demand for pipeline reasons

This commit is contained in:
Joel Falknau 2025-05-24 15:52:48 +10:00
parent 6452b082a8
commit f15c4fc708
No known key found for this signature in database

View File

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