1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-20 10:57:37 +03:00

Merge pull request #1313 from EDCD/enhancement/eddn-do-not-replaylog-unknown-schema

EDDN: Drop any 'unknown schema' messages so they're not retried
This commit is contained in:
Athanasius 2021-10-20 09:10:00 +01:00 committed by GitHub
commit 6a0325bb76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -298,7 +298,10 @@ Msg:\n{msg}'''
if unknown_schema := self.UNKNOWN_SCHEMA_RE.match(e.response.text):
logger.debug(f"EDDN doesn't (yet?) know about schema: {unknown_schema['schema_name']}"
f"/{unknown_schema['schema_version']}")
# return # Pretend it went OK so this message isn't retried
# NB: This dropping is to cater for the time when EDDN
# doesn't *yet* support a new schema.
self.replaylog.pop(0) # Drop the message
self.flush() # Truncates the file, then writes the extant data
else:
status['text'] = self.http_error_to_log(e)