-
-
Notifications
You must be signed in to change notification settings - Fork 751
Review uses of on_ready in cogs #101
Copy link
Copy link
Closed
Labels
a: backendRelated to internal functionality and utilities (error_handler, logging, security, utils and core)Related to internal functionality and utilities (error_handler, logging, security, utils and core)t: bugSomething isn't workingSomething isn't working
Metadata
Metadata
Assignees
Labels
a: backendRelated to internal functionality and utilities (error_handler, logging, security, utils and core)Related to internal functionality and utilities (error_handler, logging, security, utils and core)t: bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.
Originally posted by Scragly:
There are 12 cogs that use the event
on_readyto perform some form of preparation for that cog.While that's fine if the extension is loaded before the bot is started, any cases where loading occurs after this stage will result in the preparatory tasks not being done at all, resulting in missing data the cogs rely on to function. This includes cases where a cog may be reloaded during runtime, which often happens during development to refresh to code.
Instead of running when the bot dispatches the ready event, it would be best to instead have it prepare every time a cog is loaded, but have it wait for the bot's ready flag:
This is a job for after the Github migration.