Skip to content

Replace bot.loop.create_task usages with scheduling.create_task #1807

@Numerlor

Description

@Numerlor

Since 0b72639 we accept a loop kwarg to scheduling.create_task which can be used to create a task with a not yet running loop where asyncio.create_task doesn'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:

self.placeholder_task = scheduling.create_task(coro, event_loop=<the loop previously used to create the task>)

Metadata

Metadata

Assignees

Labels

a: backendRelated to internal functionality and utilities (error_handler, logging, security, utils and core)p: 2 - normalNormal Prioritystatus: approvedThe issue has received a core developer's approvalt: enhancementChanges or improvements to existing features

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions