Don't fail on erroneus db connection closure

This commit is contained in:
2024-08-07 16:16:46 +02:00
parent 460a8d6abb
commit 01d502337d
4 changed files with 25 additions and 15 deletions

View File

@@ -2,9 +2,9 @@ use std::vec;
use anyhow::Context;
use clap::Parser;
use sqlx::{Connection, MySqlConnection};
use sqlx::MySqlConnection;
use crate::core::user_operations::validate_user_name;
use crate::core::{common::close_database_connection, user_operations::validate_user_name};
#[derive(Parser)]
pub struct UserArgs {
@@ -67,7 +67,7 @@ pub async fn handle_command(command: UserCommand, mut conn: MySqlConnection) ->
UserCommand::ShowUser(args) => show_users(args, &mut conn).await,
};
conn.close().await?;
close_database_connection(conn).await;
result
}