// HTTP headers, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers.
// Common headers can be found in 'axum::http::header' (which is a re-export of the create 'http').
pub const REVERSE_PROXY_IP_HTTP_FIELD: &str = "x-real-ip"; // Set by the reverse proxy (Nginx).
+
+pub const MAX_DB_CONNECTION: u32 = 1024;
.pragma("foreign_keys", "ON")
.pragma("synchronous", "NORMAL");
- Self::create_connection(SqlitePoolOptions::new().connect_with(options).await?).await
+ Self::create_connection(
+ SqlitePoolOptions::new()
+ .max_connections(consts::MAX_DB_CONNECTION)
+ .connect_with(options)
+ .await?,
+ )
+ .await
}
async fn create_connection(pool: Pool<Sqlite>) -> Result<Connection> {