Skip to content

Commit

Permalink
fix(spooler): Make the backpressure management cancellation safe
Browse files Browse the repository at this point in the history
  • Loading branch information
iambriccardo committed Sep 9, 2024
1 parent d9c39f5 commit 4e57b23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion relay-server/src/services/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ impl EnvelopeBufferService {
/// Wait for the configured amount of time and make sure the project cache is ready to receive.
async fn ready_to_pop(&mut self) -> Result<(), SendError> {
tokio::time::sleep(self.sleep).await;
if let Some(project_cache_ready) = self.project_cache_ready.take() {
if let Some(project_cache_ready) = self.project_cache_ready.as_mut() {
project_cache_ready.await?;
self.project_cache_ready = None;
}

Ok(())
}

Expand Down
3 changes: 1 addition & 2 deletions relay-server/src/services/processor/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,7 @@ mod tests {

let event = Annotated::new(Event {
release: Annotated::new(
String::from("���7��#1G����7��#1G����7��#1G����7��#1G����7��#")
.into(),
String::from("���7��#1G����7��#1G����7��#1G����7��#1G����7��#").into(),
),
..Default::default()
});
Expand Down

0 comments on commit 4e57b23

Please sign in to comment.