Skip to content

Commit 80e620d

Browse files
authored
Merge pull request #236 from rararulab/issue-234-event-publish
fix(meta): return error when event publishing fails (#234)
2 parents 1a02be0 + 555540e commit 80e620d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/meta/src/handlers.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ pub async fn mark_uploaded(
241241
.context(error::DatabaseSnafu)?;
242242

243243
// Publish event so the ingestor can start transmux.
244+
// Failure here is fatal: without the event the ingestor never picks up the
245+
// video and the status stays stuck at "processing" forever.
244246
if let Err(e) = state
245247
.event_bus
246248
.send_serde_json(&DomainEvent::VideoUploaded {
@@ -249,7 +251,10 @@ pub async fn mark_uploaded(
249251
.await
250252
{
251253
tracing::warn!("failed to publish VideoUploaded event: {e}");
252-
// Non-fatal -- the status has already been updated.
254+
return error::InternalSnafu {
255+
message: format!("failed to publish VideoUploaded event: {e}"),
256+
}
257+
.fail();
253258
}
254259

255260
Ok(ApiResponse::accepted(UploadedResponse {

0 commit comments

Comments
 (0)