Skip to content

Commit 45c4ad7

Browse files
committed
BackgroundService: Remove __del__ method
We have no guarantee that the event loop is still running at the time the __del__ method is called. In fact we do see errors in the in the test cleanup phase exactly because of this. Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent a3de905 commit 45c4ad7

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/frequenz/sdk/actor/_background_service.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,6 @@ def __await__(self) -> collections.abc.Generator[None, None, None]:
268268
"""
269269
return self.wait().__await__()
270270

271-
def __del__(self) -> None:
272-
"""Destroy this instance.
273-
274-
Cancel all running tasks spawned by this background service.
275-
"""
276-
self.cancel("{self!r} was deleted")
277-
278271
def __repr__(self) -> str:
279272
"""Return a string representation of this instance.
280273

0 commit comments

Comments
 (0)