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

eddn: Bail from sending queued messages if one failed

NB: This is failed *not* due to the message being 'bad' in some manner. It
will mean the Gateway timed out, refused connection etc.
This commit is contained in:
Athanasius 2022-11-23 16:00:28 +00:00
parent 0eb33e011b
commit 32229217b2
No known key found for this signature in database
GPG Key ID: 772697E181BB2767

View File

@ -364,6 +364,8 @@ class EDDNSender:
options to not send to EDDN, or to delay the sending until docked,
are checked.
It *is* however the one 'sending' place that the EDDN killswitches are checked.
Should catch and handle all failure conditions. A `True` return might
mean that the message was successfully sent, *or* that this message
should not be retried after a failure, i.e. too large.
@ -480,10 +482,14 @@ class EDDNSender:
row = db_cursor.fetchone()
if row:
row = dict(zip([c[0] for c in db_cursor.description], row))
self.send_message_by_id(row['id'])
# Always re-schedule as this is only a "Don't hammer EDDN" delay
self.eddn.parent.after(self.eddn.REPLAY_DELAY, self.queue_check_and_send, reschedule)
have_rescheduled = True
if self.send_message_by_id(row['id']):
# If `True` was returned then we're done with this message.
# `False` means "failed to send, but not because the message
# is bad", i.e. an EDDN Gateway problem. Thus, in that case
# we do *NOT* schedule attempting the next message.
# Always re-schedule as this is only a "Don't hammer EDDN" delay
self.eddn.parent.after(self.eddn.REPLAY_DELAY, self.queue_check_and_send, reschedule)
have_rescheduled = True
db_cursor.close()