feat: add database connection pooling
This commit is contained in:
parent
e834b3308a
commit
303e3ffd4e
4 changed files with 34 additions and 7 deletions
|
|
@ -16,7 +16,7 @@ pub async fn register(
|
|||
};
|
||||
|
||||
{
|
||||
let mut conn = ctx.data().conn.lock().unwrap();
|
||||
let mut conn = ctx.data().pool.get()?;
|
||||
user_insert(&mut conn, &user);
|
||||
}
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ pub async fn register(
|
|||
#[poise::command(prefix_command, slash_command)]
|
||||
pub async fn registered(ctx: Context<'_>) -> Result<(), Error> {
|
||||
let users = {
|
||||
let mut conn = ctx.data().conn.lock().unwrap();
|
||||
let mut conn = ctx.data().pool.get()?;
|
||||
user_all(&mut conn)
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue