run_db_operation

Function run_db_operation 

Source
pub async fn run_db_operation<Fut, E, E1, T>(
    info: &str,
    operation: Fut,
    error_map: E,
) -> Result<T, Error>
where Fut: Future<Output = Result<T, E1>>, E1: Debug, E: FnOnce(E1) -> Error,
Expand description

Run a database operation and log slow operations, it also converts and logs any error with a given info for more context