Replies: 1 comment
-
One idea that comes to mind is that you could implement a custom subclass of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there any suggested, elegant way to buffer messages that could not be sent during a network outage, for later re-send when the network comes up again?
The naive, knee-jerk idea would be to write a wrapper function that is used instead of
application.bot.send_message()
, let's call itbuffered_send()
.This would do a try-except on
application.bot.send_message()
, and in case that fails, set a "network down" flag and append the passed arguments to a list.The list would be flushed (try to send) by
buffered_send()
as a first step, element by element, if not empty, or (when the "network down" flag it set) by a regulary triggered alert (JobQueue
).However I have the feeling I'm building a Rube Goldberg machine here and that this scenario already might be foreseen in the Framework somewhere... ?
Beta Was this translation helpful? Give feedback.
All reactions