mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-07 22:10:41 +02:00
fix: getting method in sio setup within try ... except block
This commit is contained in:
parent
3fe77bb4e5
commit
f35bcf3be6
@ -201,8 +201,6 @@ def setup_sio_events(sio: socketio.AsyncServer, state_manager: StateManager) ->
|
|||||||
|
|
||||||
@sio.event
|
@sio.event
|
||||||
async def trigger_method(sid: str, data: TriggerMethodDict) -> Any:
|
async def trigger_method(sid: str, data: TriggerMethodDict) -> Any:
|
||||||
method = get_object_attr_from_path(state_manager.service, data["access_path"])
|
|
||||||
|
|
||||||
async with sio.session(sid) as session:
|
async with sio.session(sid) as session:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Client [%s] is triggering the method '%s'",
|
"Client [%s] is triggering the method '%s'",
|
||||||
@ -210,6 +208,9 @@ def setup_sio_events(sio: socketio.AsyncServer, state_manager: StateManager) ->
|
|||||||
data["access_path"],
|
data["access_path"],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
method = get_object_attr_from_path(
|
||||||
|
state_manager.service, data["access_path"]
|
||||||
|
)
|
||||||
if inspect.iscoroutinefunction(method):
|
if inspect.iscoroutinefunction(method):
|
||||||
return await endpoints.trigger_async_method(
|
return await endpoints.trigger_async_method(
|
||||||
state_manager=state_manager, data=data
|
state_manager=state_manager, data=data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user