mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-08 22:40:40 +02:00
properly handle Task objects in autostart method
Tasks that are not autostart or are already running were passed to autostart_nested_services. This caused the recursion as tasks have a __self__ attribute pointing to the containing service.
This commit is contained in:
parent
56dd9dd8aa
commit
983d392ba8
@ -24,12 +24,11 @@ def autostart_service_tasks(
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
val = getattr(service, attr)
|
val = getattr(service, attr)
|
||||||
if (
|
if isinstance(val, pydase.task.task.Task):
|
||||||
isinstance(val, pydase.task.task.Task)
|
if val.autostart and val.status == TaskStatus.NOT_RUNNING:
|
||||||
and val.autostart
|
val.start()
|
||||||
and val.status == TaskStatus.NOT_RUNNING
|
else:
|
||||||
):
|
continue
|
||||||
val.start()
|
|
||||||
else:
|
else:
|
||||||
autostart_nested_service_tasks(val)
|
autostart_nested_service_tasks(val)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user