Skip to content

Commit

Permalink
tracing for user management
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Feb 10, 2024
1 parent 3e79a76 commit a22f304
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/data/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use reqwest::get;
use serde::{Deserialize, Serialize};
use sqlx::{query, query_as, Executor, Postgres};
use std::fmt::{Debug, Formatter};
use tracing::instrument;

#[derive(Serialize, Deserialize, Debug)]
pub struct User {
Expand Down Expand Up @@ -43,6 +44,7 @@ struct UserResult {
}

impl User {
#[instrument(skip(connection))]
pub async fn get(
connection: impl Executor<'_, Database = Postgres> + Copy,
steam_id: SteamId,
Expand Down Expand Up @@ -101,6 +103,7 @@ impl User {
}
}

#[instrument]
async fn fetch(steam_id: &SteamId) -> Result<Profile> {
let SteamId::Id(steam_id) = steam_id else {
return Err(Error::NotFound);
Expand Down

0 comments on commit a22f304

Please sign in to comment.