warn for slow queries in push scheduled job

This commit is contained in:
Ruben Fiszel
2025-10-03 17:30:40 +00:00
parent f9a035831f
commit 993b8d5694
5 changed files with 46 additions and 27 deletions
+1
View File
@@ -246,6 +246,7 @@ pub async fn now_from_db<'c, E: sqlx::PgExecutor<'c>>(
) -> Result<chrono::DateTime<chrono::Utc>> {
Ok(sqlx::query_scalar!("SELECT now()")
.fetch_one(db)
.warn_after_seconds_with_sql(1, "now_from_db".to_string())
.await?
.unwrap())
}