fixes task manager loop

This commit is contained in:
Mose Müller 2023-12-21 13:11:17 +01:00
parent 316ce5c7e7
commit c733026522

View File

@ -77,7 +77,6 @@ class TaskManager:
def __init__(self, service: DataService) -> None:
self.service = service
self._loop = asyncio.get_event_loop()
self.tasks: dict[str, TaskDict] = {}
"""A dictionary to keep track of running tasks. The keys are the names of the
@ -87,6 +86,10 @@ class TaskManager:
self._set_start_and_stop_for_async_methods()
@property
def _loop(self) -> asyncio.AbstractEventLoop:
return asyncio.get_running_loop()
def _set_start_and_stop_for_async_methods(self) -> None:
# inspect the methods of the class
for name, method in inspect.getmembers(