feat: make database access more uniform and stop locking as many pool connections
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
This commit is contained in:
parent
f5d4211fad
commit
fa52412b43
30 changed files with 516 additions and 373 deletions
|
@ -70,9 +70,11 @@ pub async fn users(
|
|||
return Ok(StatusCode::BAD_REQUEST.into_response());
|
||||
}
|
||||
|
||||
global_checks(&app_state, uuid).await?;
|
||||
let mut conn = app_state.pool.get().await?;
|
||||
|
||||
let users = User::fetch_amount(&mut app_state.pool.get().await?, start, amount).await?;
|
||||
global_checks(&mut conn, &app_state.config, uuid).await?;
|
||||
|
||||
let users = User::fetch_amount(&mut conn, start, amount).await?;
|
||||
|
||||
Ok((StatusCode::OK, Json(users)).into_response())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue