mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
tracing for user management
This commit is contained in:
parent
3e79a76e1b
commit
a22f304ae2
1 changed files with 3 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ use reqwest::get;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sqlx::{query, query_as, Executor, Postgres};
|
use sqlx::{query, query_as, Executor, Postgres};
|
||||||
use std::fmt::{Debug, Formatter};
|
use std::fmt::{Debug, Formatter};
|
||||||
|
use tracing::instrument;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct User {
|
pub struct User {
|
||||||
|
|
@ -43,6 +44,7 @@ struct UserResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl User {
|
impl User {
|
||||||
|
#[instrument(skip(connection))]
|
||||||
pub async fn get(
|
pub async fn get(
|
||||||
connection: impl Executor<'_, Database = Postgres> + Copy,
|
connection: impl Executor<'_, Database = Postgres> + Copy,
|
||||||
steam_id: SteamId,
|
steam_id: SteamId,
|
||||||
|
|
@ -101,6 +103,7 @@ impl User {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[instrument]
|
||||||
async fn fetch(steam_id: &SteamId) -> Result<Profile> {
|
async fn fetch(steam_id: &SteamId) -> Result<Profile> {
|
||||||
let SteamId::Id(steam_id) = steam_id else {
|
let SteamId::Id(steam_id) = steam_id else {
|
||||||
return Err(Error::NotFound);
|
return Err(Error::NotFound);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue