run_db_operation_sync

Function run_db_operation_sync 

Source
pub fn run_db_operation_sync<F, E, E1, T>(
    info: &str,
    operation: F,
    error_map: E,
) -> Result<T, Error>
where F: FnOnce() -> 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. This function is expecting a synchronous database operation