handler-id

This commit is contained in:
2023-10-18 14:59:01 +03:00
parent c11004aaef
commit 6c0f84749e
3 changed files with 5 additions and 1 deletions

View File

@@ -28,6 +28,8 @@ async fn connect_handler(
req: HttpRequest,
state: web::Data<AppState>,
) -> Result<HttpResponse, actix_web::Error> {
let handler_id: u64 = rand::random();
let token = match req.headers().get("Authorization") {
Some(val) => val.to_str().unwrap_or("").split(" ").last().unwrap_or(""),
None => match req.match_info().get("token") {
@@ -112,7 +114,7 @@ async fn connect_handler(
});
break;
} else {
println!("[handler] message handled {}", message_str);
println!("[handler {}] message handled {}", handler_id, message_str);
}
};
}