File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -187,8 +187,7 @@ async def cleanup(self) -> None:
187
187
188
188
self .events .cleaned_up .set ()
189
189
190
- async def cancel (self ) -> None :
191
- """Trigger the CancelToken and wait for the cleaned_up event to be set."""
190
+ def cancel_nowait (self ) -> None :
192
191
if self .is_cancelled :
193
192
self .logger .warning ("Tried to cancel %s, but it was already cancelled" , self )
194
193
return
@@ -198,6 +197,11 @@ async def cancel(self) -> None:
198
197
self .logger .debug ("Cancelling %s" , self )
199
198
self .events .cancelled .set ()
200
199
self .cancel_token .trigger ()
200
+
201
+ async def cancel (self ) -> None :
202
+ """Trigger the CancelToken and wait for the cleaned_up event to be set."""
203
+ self .cancel_nowait ()
204
+
201
205
try :
202
206
await asyncio .wait_for (
203
207
self .events .cleaned_up .wait (), timeout = self ._wait_until_finished_timeout )
You can’t perform that action at this time.
0 commit comments