remove dead code in aws.py - execute_with_async_client (#2287)

This commit is contained in:
Shuchang Zheng
2025-05-05 00:41:48 -07:00
committed by GitHub
parent e2a82a75d9
commit 28b1ff4872

View File

@@ -1,5 +1,5 @@
from enum import StrEnum from enum import StrEnum
from typing import IO, Any, Callable from typing import IO, Any
from urllib.parse import urlparse from urllib.parse import urlparse
import aioboto3 import aioboto3
@@ -16,20 +16,6 @@ class AWSClientType(StrEnum):
ECS = "ecs" ECS = "ecs"
def execute_with_async_client(client_type: AWSClientType) -> Callable:
def decorator(f: Callable) -> Callable:
async def wrapper(*args: list[Any], **kwargs: dict[str, Any]) -> Any:
self = args[0]
assert isinstance(self, AsyncAWSClient)
session = aioboto3.Session()
async with session.client(client_type, region_name=settings.AWS_REGION) as client:
return await f(*args, client=client, **kwargs)
return wrapper
return decorator
class AsyncAWSClient: class AsyncAWSClient:
def __init__( def __init__(
self, self,