You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document and fix how to implement custom stopping logic
The `BackgroundService` should not return early if there are no tasks
in `stop()`, as sub-classes could need to implement a custom stopping
logic. In this case it should be enough to override the `cancel()` and
`wait()` methods, and the `is_running` property.
We also add an example of how this could be done.
Signed-off-by: Leandro Lucarella <[email protected]>
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,4 +39,4 @@
39
39
40
40
## Bug Fixes
41
41
42
-
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
42
+
- Fix a bug in `BackgroundService` where it won't try to `self.cancel()` and `await self.wait()` if there are no internal tasks. This prevented to properly implement custom stop logic without having to redefine the `stop()` method too.
0 commit comments