vincbeck commented on code in PR #53454:
URL: https://github.com/apache/airflow/pull/53454#discussion_r2213850041
##########
providers/amazon/src/airflow/providers/amazon/aws/triggers/base.py:
##########
@@ -142,7 +144,12 @@ def hook(self) -> AwsGenericHook:
async def run(self) -> AsyncIterator[TriggerEvent]:
hook = self.hook()
- async with await hook.get_async_conn() as client:
+
+ if AwsBaseWaiterTrigger._shared_client is None:
+ AwsBaseWaiterTrigger._shared_client = await hook.get_async_conn()
+ client = AwsBaseWaiterTrigger._shared_client
Review Comment:
Would it be cleaner to do something like that?
```python
@classmethod
@lru_cache(maxsize=None)
async def get_client(cls):
return await hook.get_async_conn()
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]