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

repalced assert with log and continue

This commit is contained in:
A_D 2020-09-18 23:18:10 +02:00
parent 375573c0a8
commit 9710a5e9bb
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

@ -518,7 +518,13 @@ def worker() -> None:
r.raise_for_status()
this.discardedEvents = set(r.json())
this.discardedEvents.discard('Docked') # should_send() assumes that we send 'Docked' events
assert this.discardedEvents # wouldn't expect this to be empty
if not this.discardedEvents:
logger.error(
'Unexpected empty discarded events list from EDSM. Bailing out of send: '
f'{type(this.discardedEvents)} -- {this.discardedEvents}'
)
continue
# Filter out unwanted events
pending = list(filter(lambda x: x['event'] not in this.discardedEvents, pending))