mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-06 13:30:41 +02:00
fix: crashed if stopping a task that didn't run
This commit is contained in:
parent
cf46dbbdde
commit
cea831f72c
@ -125,7 +125,7 @@ class TaskManager(AbstractTaskManager):
|
|||||||
|
|
||||||
def stop_task() -> None:
|
def stop_task() -> None:
|
||||||
# cancel the task
|
# cancel the task
|
||||||
task = self.tasks.pop(name)
|
task = self.tasks.pop(name, None)
|
||||||
if task is not None:
|
if task is not None:
|
||||||
self._loop.call_soon_threadsafe(task["task"].cancel)
|
self._loop.call_soon_threadsafe(task["task"].cancel)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user