-
-
Notifications
You must be signed in to change notification settings - Fork 751
Replace bot.loop.create_task usages with scheduling.create_task #1807
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)p: 2 - normalNormal PriorityNormal Prioritystatus: approvedThe issue has received a core developer's approvalThe issue has received a core developer's approvalt: enhancementChanges or improvements to existing featuresChanges or improvements to existing features
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)p: 2 - normalNormal PriorityNormal Prioritystatus: approvedThe issue has received a core developer's approvalThe issue has received a core developer's approvalt: enhancementChanges or improvements to existing featuresChanges or improvements to existing features
Type
Fields
Give feedbackNo fields configured for issues without a type.
Since 0b72639 we accept a loop kwarg to
scheduling.create_taskwhich can be used to create a task with a not yet running loop whereasyncio.create_taskdoesn't work directly.Because the created tasks currently don't have any error handling they can hide errors in development until the task object is destroyed (if that occurs at all) which logs the exception. The scheduling alternative attaches a callback which logs exceptions to prevent this.
For every task the call should look something like this: