mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-06 05:30:39 +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:
|
||||
# cancel the task
|
||||
task = self.tasks.pop(name)
|
||||
task = self.tasks.pop(name, None)
|
||||
if task is not None:
|
||||
self._loop.call_soon_threadsafe(task["task"].cancel)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user