Remove explicit panic from db connection code (fixes #2533) (#2535)

This commit is contained in:
Nutomic 2022-11-05 00:53:46 +00:00 committed by GitHub
parent 9393195827
commit 2207fed0f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,8 +78,7 @@ async fn main() -> Result<(), LemmyError> {
let pool = Pool::builder()
.max_size(settings.database.pool_size)
.min_idle(Some(1))
.build(manager)
.unwrap_or_else(|_| panic!("Error connecting to {}", db_url));
.build(manager)?;
// Run the migrations from code
let settings_cloned = settings.to_owned();