chore (backend): show less unhelpful slow query warnings
This commit is contained in:
parent
ebcf75dcd2
commit
6f6cf0cc88
2 changed files with 3 additions and 1 deletions
|
@ -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<DbConn> = 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");
|
||||
|
|
|
@ -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"],
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue