From fcd60e5174f00ecd0f4655f52606ab388f46878c Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Fri, 1 Apr 2022 13:30:52 -0300 Subject: [PATCH] fix: Ensure aws feature builds ok in isolation --- src/sinks/aws_lambda/setup.rs | 12 +++++++----- src/sinks/aws_s3/setup.rs | 12 +++++++----- src/sinks/aws_sqs/setup.rs | 12 +++++++----- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/sinks/aws_lambda/setup.rs b/src/sinks/aws_lambda/setup.rs index d64cfb09..36de1b40 100644 --- a/src/sinks/aws_lambda/setup.rs +++ b/src/sinks/aws_lambda/setup.rs @@ -21,11 +21,13 @@ impl SinkProvider for WithUtils { fn bootstrap(&self, input: StageReceiver) -> BootstrapResult { let explicit_region = self.inner.region.to_owned(); - let aws_config = tokio::runtime::Runtime::new()?.block_on( - aws_config::from_env() - .region(Region::new(explicit_region)) - .load(), - ); + let aws_config = tokio::runtime::Builder::new_current_thread() + .build()? + .block_on( + aws_config::from_env() + .region(Region::new(explicit_region)) + .load(), + ); let retry_config = RetryConfig::new() .with_max_attempts(self.inner.max_retries.unwrap_or(DEFAULT_MAX_RETRIES)); diff --git a/src/sinks/aws_s3/setup.rs b/src/sinks/aws_s3/setup.rs index 18bfedc3..ff812f81 100644 --- a/src/sinks/aws_s3/setup.rs +++ b/src/sinks/aws_s3/setup.rs @@ -49,11 +49,13 @@ impl SinkProvider for WithUtils { fn bootstrap(&self, input: StageReceiver) -> BootstrapResult { let explicit_region = self.inner.region.to_owned(); - let aws_config = tokio::runtime::Runtime::new()?.block_on( - aws_config::from_env() - .region(Region::new(explicit_region)) - .load(), - ); + let aws_config = tokio::runtime::Builder::new_current_thread() + .build()? + .block_on( + aws_config::from_env() + .region(Region::new(explicit_region)) + .load(), + ); let retry_config = RetryConfig::new() .with_max_attempts(self.inner.max_retries.unwrap_or(DEFAULT_MAX_RETRIES)); diff --git a/src/sinks/aws_sqs/setup.rs b/src/sinks/aws_sqs/setup.rs index 6d85bf6f..9982096e 100644 --- a/src/sinks/aws_sqs/setup.rs +++ b/src/sinks/aws_sqs/setup.rs @@ -23,11 +23,13 @@ impl SinkProvider for WithUtils { fn bootstrap(&self, input: StageReceiver) -> BootstrapResult { let explicit_region = self.inner.region.to_owned(); - let aws_config = tokio::runtime::Runtime::new()?.block_on( - aws_config::from_env() - .region(Region::new(explicit_region)) - .load(), - ); + let aws_config = tokio::runtime::Builder::new_current_thread() + .build()? + .block_on( + aws_config::from_env() + .region(Region::new(explicit_region)) + .load(), + ); let retry_config = RetryConfig::new() .with_max_attempts(self.inner.max_retries.unwrap_or(DEFAULT_MAX_RETRIES));