Skip to content

Commit 866a76c

Browse files
committed
tests
1 parent a7e48f5 commit 866a76c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/conductor/client/automator/task_handler.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,15 @@ def __create_task_runner_process(
266266
metrics_settings: MetricsSettings
267267
) -> None:
268268
# Detect if worker function is async
269-
is_async_worker = inspect.iscoroutinefunction(worker.execute_function)
269+
# For function-based workers (@worker_task), check execute_function
270+
# For class-based workers, check execute method
271+
is_async_worker = False
272+
if hasattr(worker, 'execute_function'):
273+
# Function-based worker (created with @worker_task decorator)
274+
is_async_worker = inspect.iscoroutinefunction(worker.execute_function)
275+
else:
276+
# Class-based worker (implements WorkerInterface)
277+
is_async_worker = inspect.iscoroutinefunction(worker.execute)
270278

271279
if is_async_worker:
272280
# Use AsyncTaskRunner for async def workers

0 commit comments

Comments
 (0)