diff --git a/crates/meta/src/handlers.rs b/crates/meta/src/handlers.rs index 788a5b7..5ad1c58 100644 --- a/crates/meta/src/handlers.rs +++ b/crates/meta/src/handlers.rs @@ -251,6 +251,14 @@ pub async fn mark_uploaded( .await { tracing::warn!("failed to publish VideoUploaded event: {e}"); + + // Roll back status to Uploading so the client can retry the request. + if let Err(rollback_err) = + video_repo::update_status(&state.db, &video_id, VideoStatus::Uploading).await + { + tracing::error!("failed to rollback video status: {rollback_err}"); + } + return error::InternalSnafu { message: format!("failed to publish VideoUploaded event: {e}"), }