mirror of
https://github.com/tiqi-group/pydase.git
synced 2026-01-19 02:12:25 +01:00
Skip coroutines with arguments instead of raising an exception
This commit is contained in:
committed by
B108 Rpi Server
parent
46868743c7
commit
eacd5bc6b1
@@ -107,12 +107,13 @@ class TaskManager:
|
|||||||
method = getattr(self.service, name)
|
method = getattr(self.service, name)
|
||||||
if inspect.iscoroutinefunction(method):
|
if inspect.iscoroutinefunction(method):
|
||||||
if function_has_arguments(method):
|
if function_has_arguments(method):
|
||||||
raise TaskDefinitionError(
|
logger.info(
|
||||||
"Asynchronous functions (tasks) should be defined without "
|
"Asynchronous functions (tasks) should be defined without "
|
||||||
f"arguments. The task '{method.__name__}' has at least one "
|
f"arguments. The task '{method.__name__}' has at least one "
|
||||||
"argument. Please remove the argument(s) from this function to "
|
"argument. Please remove the argument(s) from this function to "
|
||||||
"use it."
|
"use it in the frontend."
|
||||||
)
|
)
|
||||||
|
continue
|
||||||
|
|
||||||
# create start and stop methods for each coroutine
|
# create start and stop methods for each coroutine
|
||||||
setattr(
|
setattr(
|
||||||
|
|||||||
Reference in New Issue
Block a user