Skip to content

Commit

Permalink
replaced map_err with inspect_err since we do not modify the error in…
Browse files Browse the repository at this point in the history
… any way
  • Loading branch information
simon-wg committed Nov 6, 2024
1 parent a5d0b2e commit 6f28cbc
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions backend/src/handlers/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,16 @@ async fn update_sessions(
user_session_repo
.update_sessions(&user_ids)
.await
.map_err(|e| {
warn!("[Update sessions] Could not update user sessions");
e
})?;
.inspect_err(|_e| warn!("[Update sessions] Could not update user sessions"))?;

let devices = devices
.into_iter()
.map(|device| (device.user_id, device.address))
.collect::<Vec<_>>();
session_repo.update_sessions(&devices).await.map_err(|e| {
warn!("[Update sessions] Could not update sessions");
e
})?;
session_repo
.update_sessions(&devices)
.await
.inspect_err(|_e| warn!("[Update sessions] Could not update sessions"))?;

Ok(HttpResponse::Ok().finish())
}
Expand Down

0 comments on commit 6f28cbc

Please sign in to comment.