1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-12-05 10:42:14 +03:00

Better DB operations tracing

This commit is contained in:
Quentin Gliech
2022-10-21 14:36:58 +02:00
parent 5580179537
commit 770541eb38
8 changed files with 206 additions and 45 deletions

View File

@@ -25,10 +25,20 @@ pub mod client;
pub mod consent;
pub mod refresh_token;
#[tracing::instrument(
skip_all,
fields(
session.id = %session.data,
user.id = %session.browser_session.user.data,
user_session.id = %session.browser_session.data,
client.id = %session.client.data,
),
err(Debug),
)]
pub async fn end_oauth_session(
executor: impl PgExecutor<'_>,
session: Session<PostgresqlBackend>,
) -> anyhow::Result<()> {
) -> Result<(), anyhow::Error> {
let finished_at = Utc::now();
let res = sqlx::query!(
r#"