mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-22 03:06:59 +03:00
CAPI: return good data from worker & start handling reauth
This commit is contained in:
2 files changed
+15
-6
No files matched your search
@@ -1075,6 +1075,13 @@ class AppWindow(object):
|
||||
# TODO: Set status text
|
||||
return
|
||||
|
||||
except companion.CredentialsError:
|
||||
# Redirected back to Auth server - force full re-authentication
|
||||
companion.session.dump(r)
|
||||
companion.session.invalidate()
|
||||
companion.session.retrying = False
|
||||
companion.session.login()
|
||||
|
||||
# Companion API problem
|
||||
except companion.ServerLagging as e:
|
||||
err = str(e)
|
||||
|
||||
+8
-6
@@ -642,12 +642,10 @@ class Session(object):
|
||||
|
||||
if r.url.startswith(SERVER_AUTH):
|
||||
logger.info('Redirected back to Auth Server')
|
||||
# Redirected back to Auth server - force full re-authentication
|
||||
self.dump(r)
|
||||
self.invalidate()
|
||||
self.retrying = False
|
||||
self.login()
|
||||
raise CredentialsError()
|
||||
self.capi_response_queue.put(
|
||||
CAPIFailedRequest(f'Redirected back to Auth Server', exception=CredentialsError()
|
||||
)
|
||||
continue
|
||||
|
||||
elif 500 <= r.status_code < 600:
|
||||
# Server error. Typically 500 "Internal Server Error" if server is down
|
||||
@@ -656,6 +654,10 @@ class Session(object):
|
||||
# LANG: Frontier CAPI data retrieval failed with 5XX code
|
||||
raise ServerError(f'{_("Frontier CAPI server error")}: {r.status_code}')
|
||||
|
||||
self.capi_response_queue.put(
|
||||
data
|
||||
)
|
||||
|
||||
logger.info('CAPI worker thread DONE')
|
||||
|
||||
def capi_query_close_worker(self) -> None:
|
||||
|
||||
Reference in new issue
Block a user