We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
TASKS
1 parent 9c728df commit 30ac392Copy full SHA for 30ac392
pydis_core/utils/scheduling.py
@@ -10,6 +10,8 @@
10
11
from pydis_core.utils import logging
12
13
+TASKS = set[asyncio.Task]
14
+
15
16
class Scheduler:
17
"""
@@ -238,6 +240,9 @@ def create_task(
238
240
task = event_loop.create_task(coro, **kwargs)
239
241
else:
242
task = asyncio.create_task(coro, **kwargs)
243
244
+ TASKS.add(task)
245
+ task.add_done_callback(TASKS.discard)
246
task.add_done_callback(partial(_log_task_exception, suppressed_exceptions=suppressed_exceptions))
247
return task
248
0 commit comments