public class ApiCooldownManager extends Object
| Constructor and Description |
|---|
ApiCooldownManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
enforceCooldown(String serviceKey)
Checks if a global cooldown is active for the service.
|
void |
recordCooldown(String serviceKey,
long actualRetryDelayMillis)
Records or updates a global cooldown period for a service.
|
public void enforceCooldown(String serviceKey) throws InterruptedException
serviceKey - Identifier for the AI service.InterruptedException - if the thread is interrupted while sleeping.public void recordCooldown(String serviceKey, long actualRetryDelayMillis)
serviceKey - Identifier for the AI service.actualRetryDelayMillis - The delay received from the API.Copyright © 2026. All rights reserved.