mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 04:20:17 +02:00
keep on demand for pipeline reasons
This commit is contained in:
parent
6452b082a8
commit
f15c4fc708
@ -181,6 +181,25 @@ class EveSwaggerProvider(EveProvider):
|
|||||||
self.adapter = adapter or self
|
self.adapter = adapter or self
|
||||||
self._faction_list = None # what are the odds this will change? could cache forever!
|
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
|
@property
|
||||||
def client(self) -> SwaggerClient:
|
def client(self) -> SwaggerClient:
|
||||||
if self._client is None:
|
if self._client is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user