This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 4f6d24f use different logger to avoid duplicate log entry (#22256)
4f6d24f is described below
commit 4f6d24f8658e0896c46e613aa656a853b358c321
Author: Zach Liu <[email protected]>
AuthorDate: Mon Mar 14 14:31:00 2022 -0400
use different logger to avoid duplicate log entry (#22256)
https://github.com/apache/airflow/pull/22137#issuecomment-1067060405
---
airflow/providers/amazon/aws/hooks/base_aws.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/airflow/providers/amazon/aws/hooks/base_aws.py
b/airflow/providers/amazon/aws/hooks/base_aws.py
index 16c7385..bbf0bff 100644
--- a/airflow/providers/amazon/aws/hooks/base_aws.py
+++ b/airflow/providers/amazon/aws/hooks/base_aws.py
@@ -584,13 +584,14 @@ class AwsBaseHook(BaseHook):
min_limit = retry_args.get('min', 1)
max_limit = retry_args.get('max', 1)
stop_after_delay = retry_args.get('stop_after_delay', 10)
- tenacity_logger = tenacity.before_log(self.log, logging.INFO)
if self.log else None
+ tenacity_before_logger = tenacity.before_log(self.log,
logging.INFO) if self.log else None
+ tenacity_after_logger = tenacity.after_log(self.log,
logging.INFO) if self.log else None
default_kwargs = {
'wait': tenacity.wait_exponential(multiplier=multiplier,
max=max_limit, min=min_limit),
'retry': tenacity.retry_if_exception(should_retry),
'stop': tenacity.stop_after_delay(stop_after_delay),
- 'before': tenacity_logger,
- 'after': tenacity_logger,
+ 'before': tenacity_before_logger,
+ 'after': tenacity_after_logger,
}
return tenacity.retry(**default_kwargs)(fun)(self, *args,
**kwargs)