1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-09-25 14:19:45 +00:00

Can now turn optionally User WS Controller as async functions

This commit is contained in:
2022-03-11 22:51:30 +01:00
parent 0a9ff17615
commit cfaaef68b7
2 changed files with 37 additions and 58 deletions

View File

@@ -25,7 +25,7 @@ use crate::data::user_ws_message::UserWsMessage;
use crate::data::user_ws_request_handler::{UserWsRequestHandler, UserWsResponseType};
use crate::helpers::{account_helper, events_helper};
use crate::helpers::events_helper::Event;
use crate::user_ws_routes::find_user_ws_route;
use crate::user_ws_routes::exec_user_ws_route;
use crate::utils::crypt_utils::rand_str;
use crate::utils::date_utils::time;
@@ -266,13 +266,9 @@ impl WsSession {
args,
);
let result = match find_user_ws_route(&incoming_msg.title) {
None => {
handler.not_found("Route not found!".to_string())
}
Some(r) => {
(r.handler)(&mut handler)
}
let result = match exec_user_ws_route(&incoming_msg.title, &mut handler).await {
None => handler.not_found("Route not found!".to_string()),
Some(r) => r
};
if !handler.has_response() {