[test] logger ignoring NetworkError | Backup period buttons fix(?)

pull/143/head
ZetGo | Aleksej K. 2025-06-05 23:29:24 +03:00
parent 3ffe206314
commit 05c36af560
2 changed files with 7 additions and 1 deletions

View File

@ -527,6 +527,12 @@ rotating_handler.setFormatter(_main_formatter)
def init():
class NoFetchUpdatesFilter(logging.Filter):
def filter(self, record: logging.LogRecord) -> bool:
msg = record.getMessage()
return "Failed to fetch updates" not in msg
logging.getLogger("aiogram.dispatcher").addFilter(NoFetchUpdatesFilter())
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
handler.setFormatter(_main_formatter)

View File

@ -80,7 +80,7 @@ class HerokuBackupMod(loader.Module):
async def _set_backup_period(self, call: BotInlineCall, value: int):
if not value:
self.set("period", "disabled")
await call.answer(self.strings("never"), show_alert=True)
await self.inline.bot(call.answer(self.strings("never"), show_alert=True))
await call.delete()
return