1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 15:57:14 +03:00

plugins/edsm: Only try to send if pending isn't empty

This prevents literally sending an empty data to EDSM if we trigger
sending due to Shutdown.
This commit is contained in:
Athanasius 2021-08-05 16:22:46 +01:00
parent f2d7f6a5df
commit 64f97accc0
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D

View File

@ -643,7 +643,7 @@ def worker() -> None: # noqa: CCR001 C901 # Cant be broken up currently
pending.append(entry)
if should_send(pending, entry['event']):
if pending and should_send(pending, entry['event']):
if 'edsm-cmdr-events' in trace_on:
logger.trace(f'({cmdr=}, {entry["event"]=}): should_send() said True')
pendings = [f"{p}\n" for p in pending]