fix: raise error when Telegram bot not running instead of silently dropping messages
When the outbound dispatcher processes recovery notifications before the Telegram bot is fully started, the send() method silently returned, causing the notification to be lost. Now it raises RuntimeError so _send_with_retry will retry until the bot is ready.
This commit is contained in:
1 parent
79a0fd8ed0
commit
d5d6c76a93
1 file changed
+1
-1
@@ -729,7 +729,7 @@ class TelegramChannel(BaseChannel):
|
|||||||
"""Send a message through Telegram."""
|
"""Send a message through Telegram."""
|
||||||
if not self._app:
|
if not self._app:
|
||||||
self.logger.warning("bot not running")
|
self.logger.warning("bot not running")
|
||||||
return
|
raise RuntimeError("Telegram bot is not running")
|
||||||
|
|
||||||
progress_event = msg.event if isinstance(msg.event, ProgressEvent) else None
|
progress_event = msg.event if isinstance(msg.event, ProgressEvent) else None
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user