Skip to content

Commit

Permalink
ref(metrics): Block in place is no longer necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde committed Dec 19, 2024
1 parent c1233b4 commit 184b02d
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions relay-server/src/services/metrics/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,6 @@ impl AggregatorService {
///
/// Returns when the next flush should be attempted.
fn try_flush(&mut self) -> Duration {
if cfg!(test) {
// Tests are running in a single thread / current thread runtime,
// which is required for 'fast-forwarding' and `block_in_place`
// requires a multi threaded runtime. Relay always requires a multi
// threaded runtime.
self.do_try_flush()
} else {
tokio::task::block_in_place(|| self.do_try_flush())
}
}

fn do_try_flush(&mut self) -> Duration {
let partition = match self.aggregator.try_flush_next(SystemTime::now()) {
Ok(partition) => partition,
Err(duration) => return duration,
Expand Down

0 comments on commit 184b02d

Please sign in to comment.