Page MenuHomePhabricator

D11826.id39943.diff
No OneTemporary

D11826.id39943.diff

diff --git a/services/identity/src/websockets/auth.rs b/services/identity/src/websockets/auth.rs
--- a/services/identity/src/websockets/auth.rs
+++ b/services/identity/src/websockets/auth.rs
@@ -12,6 +12,7 @@
const PLACEHOLDER_CODE_VERSION: u64 = 0;
const DEVICE_TYPE: &str = "service";
+#[tracing::instrument(skip_all)]
async fn verify_user_access_token(
user_id: &str,
device_id: &str,
@@ -50,6 +51,7 @@
Ok(response.into_inner().token_valid)
}
+#[tracing::instrument(skip_all)]
pub async fn handle_auth_message(message: &str) -> Result<(), WebsocketError> {
let auth_message = serde_json::from_str(message.trim());
diff --git a/services/identity/src/websockets/mod.rs b/services/identity/src/websockets/mod.rs
--- a/services/identity/src/websockets/mod.rs
+++ b/services/identity/src/websockets/mod.rs
@@ -95,6 +95,7 @@
}
}
+#[tracing::instrument(skip_all)]
pub async fn run_server() -> Result<(), errors::BoxedError> {
let addr: SocketAddr = IDENTITY_SERVICE_WEBSOCKET_ADDR.parse()?;
let listener = TcpListener::bind(&addr).await.expect("Failed to bind");
@@ -120,6 +121,7 @@
Ok(())
}
+#[tracing::instrument(skip_all)]
async fn send_search_request<T: Serialize>(
url: &str,
json_body: T,
@@ -134,12 +136,14 @@
.await
}
+#[tracing::instrument(skip_all)]
async fn close_connection(outgoing: WebsocketSink) {
if let Err(e) = outgoing.lock().await.close().await {
error!("Error closing connection: {}", e);
}
}
+#[tracing::instrument(skip_all)]
async fn handle_prefix_search(
request_id: &str,
prefix_request: identity_search_messages::IdentitySearchPrefix,
@@ -178,6 +182,7 @@
Ok(search_result)
}
+#[tracing::instrument(skip_all)]
async fn handle_websocket_frame(
text: String,
outgoing: WebsocketSink,
@@ -217,6 +222,7 @@
}
}
+#[tracing::instrument(skip_all)]
async fn accept_connection(hyper_ws: HyperWebsocket, addr: SocketAddr) {
debug!("Incoming WebSocket connection from {}", addr);
diff --git a/services/identity/src/websockets/send.rs b/services/identity/src/websockets/send.rs
--- a/services/identity/src/websockets/send.rs
+++ b/services/identity/src/websockets/send.rs
@@ -11,6 +11,7 @@
pub type WebsocketSink =
Arc<Mutex<SplitSink<WebSocketStream<Upgraded>, Message>>>;
+#[tracing::instrument(skip_all)]
pub async fn send_message(message: Message, outgoing: WebsocketSink) {
if let Err(e) = outgoing.lock().await.send(message).await {
error!("Failed to send message to device: {}", e);

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 9, 8:50 PM (11 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2839429
Default Alt Text
D11826.id39943.diff (2 KB)

Event Timeline