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
|
@ -128,9 +128,11 @@ pub async fn get_guilds(
|
|||
let start = request_query.start.unwrap_or(0);
|
||||
let amount = request_query.amount.unwrap_or(10);
|
||||
|
||||
global_checks(&app_state, uuid).await?;
|
||||
let mut conn = app_state.pool.get().await?;
|
||||
|
||||
let guilds = Guild::fetch_amount(&app_state.pool, start, amount).await?;
|
||||
global_checks(&mut conn, &app_state.config, uuid).await?;
|
||||
|
||||
let guilds = Guild::fetch_amount(&mut conn, start, amount).await?;
|
||||
|
||||
Ok((StatusCode::OK, Json(guilds)))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue