Log when an output file is too large

This commit is contained in:
Nexus 2024-04-14 23:20:35 +01:00
parent 81fa1454ed
commit 60e4ed5570
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -113,6 +113,12 @@ class AutoResponder(commands.Cog):
if file: if file:
if _p.stat().st_size <= 24.5 * 1024 * 1024: if _p.stat().st_size <= 24.5 * 1024 * 1024:
await message.reply(file=file) await message.reply(file=file)
else:
self.log.warning(
"Transcoded file too large: %r (%.2f)MB",
_p,
_p.stat().st_size / 1024 / 1024
)
except Exception as e: except Exception as e:
self.log.error("Failed to transcode %r: %r", link, e) self.log.error("Failed to transcode %r: %r", link, e)