From 32229217b2c5676ae8c6530fcf1bc026131705dc Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 23 Nov 2022 16:00:28 +0000 Subject: [PATCH] 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. --- plugins/eddn.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/eddn.py b/plugins/eddn.py index cc94ff1a..805f45cf 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -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()