mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-23 01:20:03 +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
|
||||
|
||||
val = getattr(service, attr)
|
||||
if (
|
||||
isinstance(val, pydase.task.task.Task)
|
||||
and val.autostart
|
||||
and val.status == TaskStatus.NOT_RUNNING
|
||||
):
|
||||
val.start()
|
||||
if isinstance(val, pydase.task.task.Task):
|
||||
if val.autostart and val.status == TaskStatus.NOT_RUNNING:
|
||||
val.start()
|
||||
else:
|
||||
continue
|
||||
else:
|
||||
autostart_nested_service_tasks(val)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user