From 184b02d98a3dfd9c11667ff1a017fef7216687fa Mon Sep 17 00:00:00 2001 From: David Herberth Date: Thu, 19 Dec 2024 15:16:29 +0100 Subject: [PATCH] ref(metrics): Block in place is no longer necessary --- relay-server/src/services/metrics/aggregator.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/relay-server/src/services/metrics/aggregator.rs b/relay-server/src/services/metrics/aggregator.rs index b81b804f91..674d43dfd2 100644 --- a/relay-server/src/services/metrics/aggregator.rs +++ b/relay-server/src/services/metrics/aggregator.rs @@ -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,