From 74e49a0d3d4a446af2762854d9fd13c744aeb741 Mon Sep 17 00:00:00 2001 From: Tim-Oliver Husser Date: Thu, 28 Dec 2023 18:43:55 +0100 Subject: [PATCH] added awaits for can_run() --- pyobs/robotic/scripts/parallel.py | 4 +++- pyobs/robotic/scripts/sequential.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyobs/robotic/scripts/parallel.py b/pyobs/robotic/scripts/parallel.py index fe68b5c5..51f47af9 100644 --- a/pyobs/robotic/scripts/parallel.py +++ b/pyobs/robotic/scripts/parallel.py @@ -42,7 +42,9 @@ async def run( task_archive: Optional[TaskArchive] = None, ) -> None: scripts = [self.get_object(s, Script) for s in self.scripts] - tasks = [asyncio.create_task(s.run(task_runner, task_schedule, task_archive)) for s in scripts if s.can_run()] + tasks = [ + asyncio.create_task(s.run(task_runner, task_schedule, task_archive)) for s in scripts if await s.can_run() + ] await asyncio.gather(*tasks) diff --git a/pyobs/robotic/scripts/sequential.py b/pyobs/robotic/scripts/sequential.py index 36870f1d..dc1152c2 100644 --- a/pyobs/robotic/scripts/sequential.py +++ b/pyobs/robotic/scripts/sequential.py @@ -41,7 +41,7 @@ async def run( ) -> None: for s in self.scripts: script = self.get_object(s, Script) - if script.can_run(): + if await script.can_run(): await script.run(task_runner, task_schedule, task_archive)