mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-02 09:11:22 +00:00
fix
This commit is contained in:
parent
4428c61bea
commit
84b161ddd6
1 changed files with 2 additions and 10 deletions
|
@ -1,12 +1,4 @@
|
||||||
use crate::{
|
use crate::{newtypes::DbUrl, schema_setup, CommentSortType, SortType};
|
||||||
diesel::ExpressionMethods,
|
|
||||||
newtypes::{DbUrl, CommentSortType, PersonId},
|
|
||||||
schema::community,
|
|
||||||
schema_setup,
|
|
||||||
CommentSortType,
|
|
||||||
CommunityVisibility,
|
|
||||||
SortType,
|
|
||||||
};
|
|
||||||
use chrono::{DateTime, TimeDelta, Utc};
|
use chrono::{DateTime, TimeDelta, Utc};
|
||||||
use deadpool::Runtime;
|
use deadpool::Runtime;
|
||||||
use diesel::{
|
use diesel::{
|
||||||
|
@ -435,7 +427,7 @@ pub async fn build_db_pool() -> LemmyResult<ActualDbPool> {
|
||||||
// provide a setup function which handles creating the connection
|
// provide a setup function which handles creating the connection
|
||||||
let mut config = ManagerConfig::default();
|
let mut config = ManagerConfig::default();
|
||||||
config.custom_setup = Box::new(establish_connection);
|
config.custom_setup = Box::new(establish_connection);
|
||||||
let manager = AsyncDieselConnectionManager::<AsyncPgConnection>::new_with_config(&db_url, config);
|
let manager = AsyncDieselConnectionManager::<AsyncPgConnection>::new_with_config(db_url, config);
|
||||||
let pool = Pool::builder(manager)
|
let pool = Pool::builder(manager)
|
||||||
.max_size(SETTINGS.database.pool_size)
|
.max_size(SETTINGS.database.pool_size)
|
||||||
.runtime(Runtime::Tokio1)
|
.runtime(Runtime::Tokio1)
|
||||||
|
|
Loading…
Reference in a new issue