diff --git a/packages/backend-rs/src/database/postgresql.rs b/packages/backend-rs/src/database/postgresql.rs index ed68227419..42b5605397 100644 --- a/packages/backend-rs/src/database/postgresql.rs +++ b/packages/backend-rs/src/database/postgresql.rs @@ -4,6 +4,7 @@ use crate::config::CONFIG; use once_cell::sync::OnceCell; use sea_orm::{ConnectOptions, Database, DbConn, DbErr}; use tracing::log::LevelFilter; +use std::time::Duration; static DB_CONN: OnceCell = OnceCell::new(); @@ -18,6 +19,7 @@ async fn init_conn() -> Result<&'static DbConn, DbErr> { ); let option: ConnectOptions = ConnectOptions::new(database_uri) .sqlx_logging_level(LevelFilter::Trace) + .sqlx_slow_statements_logging_settings(LevelFilter::Warn, Duration::from_secs(3)) .to_owned(); tracing::info!("initializing connection"); diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index 62bd2f9a1c..67954b1033 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -219,7 +219,7 @@ export const db = new DataSource({ : false, logging: log, logger: log ? new DbLogger() : undefined, - maxQueryExecutionTime: 300, + maxQueryExecutionTime: 3000, entities: entities, migrations: ["../../migration/*.js"], });