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

plugins/edsm: should_send() == True for any Shutdown event

We MUST attempt flushing pending events in case of commander change.
This commit is contained in:
Athanasius 2021-08-05 15:01:33 +01:00
parent ba7c2de593
commit 26115a14f0
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D

View File

@ -760,6 +760,13 @@ def should_send(entries: List[Mapping[str, Any]]) -> bool: # noqa: CCR001
:param entries: The entries to check
:return: bool indicating whether or not to send said entries
"""
# We MUST flush pending on logout, in case new login is a different Commander
if any(e for e in entries if e['event'] == 'Shutdown'):
if 'edsm-cmdr-events' in trace_on:
logger.trace('True because Shutdown')
return True
# batch up burst of Scan events after NavBeaconScan
if this.navbeaconscan:
if entries and entries[-1]['event'] == 'Scan':