Skip to content

Commit 2b9931b

Browse files
committed
fixes
1 parent eac43a8 commit 2b9931b

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

opentelemetry-sdk/src/trace/span_processor_with_async_runtime.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,16 @@ impl<E: SpanExporter, R: RuntimeChannel> BatchSpanProcessorInternal<E, R> {
307307
}
308308

309309
let export = self.exporter.export(self.spans.split_off(0));
310-
let timeout_future = Box::pin(self.runtime.delay(self.config.max_export_timeout));
311-
let timeout = self.config.max_export_timeout;
310+
let timeout = self.runtime.delay(self.config.max_export_timeout);
311+
let time_out = self.config.max_export_timeout;
312312

313-
Box::pin(async move {
314-
match future::select(export, timeout_future).await {
315-
Either::Left((export_res, _)) => export_res,
316-
Either::Right((_, _)) => Err(OTelSdkError::Timeout(timeout)),
317-
}
318-
})
313+
pin_mut!(export);
314+
pin_mut!(timeout);
315+
316+
match future::select(export, timeout).await {
317+
Either::Left((export_res, _)) => export_res,
318+
Either::Right((_, _)) => Err(OTelSdkError::Timeout(time_out)),
319+
}
319320
}
320321

321322
async fn run(mut self, mut messages: impl FusedStream<Item = BatchMessage> + Unpin) {

0 commit comments

Comments
 (0)