Skip to content

Commit

Permalink
renamed constants for more idiomatic meaning
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-armah committed Jan 10, 2025
1 parent f09df48 commit ace9f19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions integrations/aws/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ async def list_resources(


class CloudControlThrottlingConfig(enum.Enum):
RATE_LIMITER_MAX_RATE: int = 100
RATE_LIMITER_TIME_PERIOD: float = 60.0 # in seconds
MAX_RATE: int = 100
TIME_PERIOD: float = 60.0 # in seconds
SEMAPHORE: int = 50
MAX_RETRY_ATTEMPTS: int = 100
RETRY_MODE: Literal["legacy", "standard", "adaptive"] = "adaptive"
Expand Down
8 changes: 4 additions & 4 deletions integrations/aws/utils/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ async def describe_single_resource(
CloudControlThrottlingConfig.SEMAPHORE.value
)
rate_limiter = AsyncLimiter(
CloudControlThrottlingConfig.RATE_LIMITER_MAX_RATE.value,
CloudControlThrottlingConfig.RATE_LIMITER_TIME_PERIOD.value,
CloudControlThrottlingConfig.MAX_RATE.value,
CloudControlThrottlingConfig.TIME_PERIOD.value,
)
return await describe_single_resource_cloudcontrol(
kind, identifier, cloudcontrol, semaphore, rate_limiter
Expand Down Expand Up @@ -216,8 +216,8 @@ async def resync_cloudcontrol(
CloudControlThrottlingConfig.SEMAPHORE.value
)
rate_limiter = AsyncLimiter(
CloudControlThrottlingConfig.RATE_LIMITER_MAX_RATE.value,
CloudControlThrottlingConfig.RATE_LIMITER_TIME_PERIOD.value,
CloudControlThrottlingConfig.MAX_RATE.value,
CloudControlThrottlingConfig.TIME_PERIOD.value,
)
async with session.client("cloudcontrol") as cloudcontrol:
while True:
Expand Down

0 comments on commit ace9f19

Please sign in to comment.