File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -192,16 +192,17 @@ async def run_with_semaphore():
192
192
async with self ._semaphore :
193
193
await self .coro (* args , ** kwargs )
194
194
195
- self ._tasks .append (
196
- asyncio .create_task (
197
- (
198
- self .coro (* args , ** kwargs )
199
- if self .overlap is True
200
- else run_with_semaphore ()
201
- ),
202
- name = f"pycord-loop-{ self .coro .__name__ } -{ self ._current_loop } " ,
203
- )
195
+ task = asyncio .create_task (
196
+ (
197
+ self .coro (* args , ** kwargs )
198
+ if self .overlap is True
199
+ else run_with_semaphore ()
200
+ ),
201
+ name = f"pycord-loop-{ self .coro .__name__ } -{ self ._current_loop } " ,
204
202
)
203
+ task .add_done_callback (self ._tasks .remove )
204
+ self ._tasks .append (task )
205
+
205
206
_current_loop_ctx .reset (token )
206
207
self ._last_iteration_failed = False
207
208
backoff = ExponentialBackoff ()
You can’t perform that action at this time.
0 commit comments