Skip to content

Commit f20fc23

Browse files
committed
fixed issue with worker.run not awaited
1 parent 01a66f4 commit f20fc23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pydra/engine/workers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ def run(self, task: "Task[DefType]", rerun: bool = False) -> "Result":
4949
pass
5050

5151
async def run_async(self, task: "Task[DefType]", rerun: bool = False) -> "Result":
52+
assert self.is_async, "Worker is not asynchronous"
5253
if task.is_async: # only for workflows at this stage and the foreseeable
5354
# These jobs are run in the primary process but farm out the workflows jobs
5455
return await task.run_async(rerun=rerun)
5556
else:
56-
return self.run(task=task, rerun=rerun)
57+
return await self.run(task=task, rerun=rerun)
5758

5859
def close(self):
5960
"""Close this worker."""

0 commit comments

Comments
 (0)