Skip to content

Commit 4dc7593

Browse files
Amrou BellalounaAmrou Bellalouna
authored andcommitted
save newly created tasks in a set
1 parent b0384ec commit 4dc7593

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pydis_core/utils/scheduling.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from pydis_core.utils import logging
1212

13-
TASKS = set[asyncio.Task]
13+
_background_tasks = set[asyncio.Task]
1414

1515

1616
class Scheduler:
@@ -241,8 +241,8 @@ def create_task(
241241
else:
242242
task = asyncio.create_task(coro, **kwargs)
243243

244-
TASKS.add(task)
245-
task.add_done_callback(TASKS.discard)
244+
_background_tasks.add(task)
245+
task.add_done_callback(_background_tasks.discard)
246246
task.add_done_callback(partial(_log_task_exception, suppressed_exceptions=suppressed_exceptions))
247247
return task
248248

0 commit comments

Comments
 (0)