use std::time::Duration; use crate::prelude::*; pub async fn delete( State(AppState { pool, ref storage }): State, claims: Claims, ) -> GeneralResult { tokio::time::sleep(Duration::from_secs(100)).await; db::users::delete_user(claims.user_id, &pool) .try_for_each_concurrent(5, |file_id| async move { let _ = storage.delete(file_id).await; Ok(()) }) .await .handle_internal("Error deleting the user")?; Ok(EmptyResponse) }