1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-21 11:27:38 +03:00

companion.py: Move check for CAPI pretend down

This commit is contained in:
norohind 2021-08-16 15:30:14 +03:00
parent 8d6fae6ef6
commit e6c6f7f155
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1

@ -564,11 +564,11 @@ class Session(object):
logger.error('cannot make a query when unauthorized')
raise CredentialsError('cannot make a query when unauthorized')
try:
logger.trace_if('capi.query', 'Trying...')
if conf_module.capi_pretend_down:
raise ServerConnectionError(f'Pretending CAPI down: {endpoint}')
logger.trace_if('capi.query', 'Trying...')
if conf_module.capi_pretend_down:
raise ServerConnectionError(f'Pretending CAPI down: {endpoint}')
try:
r = self.session.get(self.server + endpoint, timeout=timeout) # type: ignore
except requests.ConnectionError as e: