Skip to content

Commit

Permalink
Server: exit early if endpoints don't exist
Browse files Browse the repository at this point in the history
Ensure that we don't try to process a message for which endpoints
no longer exist. Fixes #1511.
  • Loading branch information
jaymell authored and svix-james committed Nov 11, 2024
1 parent ecfb377 commit 81a4ca3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/svix-server/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,11 @@ async fn process_queue_task_inner(
})
.collect();

if destinations.is_empty() {
tracing::debug!("No destinations for message. Returning");
return Ok(());
}

messagedestination::Entity::insert_many(destinations.clone())
.exec(db)
.await?;
Expand Down

0 comments on commit 81a4ca3

Please sign in to comment.