perf: reuse aiohttp.ClientSession in rubylogging (new session per deleted-message event) #7
Labels
No labels
bug
compliance
documentation
duplicate
enhancement
gdpr
good first issue
help wanted
invalid
performance
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: SheWhoReignsSupreme/EveCogs#7
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
rubylogging: Newaiohttp.ClientSessioncreated on every deleted-message eventIn
rubylogging/rubylogging.py(around line 460), a newaiohttp.ClientSessionis instantiated for everyon_message_deleteevent that has attachments with re-upload enabled. This is a hot path on active servers.Problem
ResourceWarning: Unclosed connectorin logs when session exits quicklyFix
Store a session at cog init and reuse it:
Same pattern in other cogs (lower severity — not hot paths)
nexuscore/applications.py:345— per application submissionnexuscore/moderation.py:312— per cross-server banwormhole/services/emoji.py:47— per emoji fetchThe nexuscore/wormhole ones are low-frequency commands so lower priority, but worth fixing for consistency.