Merge pull request #2120 from gaoren002/fix/rate-limit-429-cooldown-config
fix(rate-limit): make 429 fallback cooldown configurable
This commit is contained in:
@@ -805,6 +805,30 @@ export async function updateOverloadCooldownSettings(
|
||||
return data;
|
||||
}
|
||||
|
||||
// ==================== 429 Rate Limit Cooldown Settings ====================
|
||||
|
||||
export interface RateLimit429CooldownSettings {
|
||||
enabled: boolean;
|
||||
cooldown_seconds: number;
|
||||
}
|
||||
|
||||
export async function getRateLimit429CooldownSettings(): Promise<RateLimit429CooldownSettings> {
|
||||
const { data } = await apiClient.get<RateLimit429CooldownSettings>(
|
||||
"/admin/settings/rate-limit-429-cooldown",
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function updateRateLimit429CooldownSettings(
|
||||
settings: RateLimit429CooldownSettings,
|
||||
): Promise<RateLimit429CooldownSettings> {
|
||||
const { data } = await apiClient.put<RateLimit429CooldownSettings>(
|
||||
"/admin/settings/rate-limit-429-cooldown",
|
||||
settings,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
// ==================== Stream Timeout Settings ====================
|
||||
|
||||
/**
|
||||
@@ -1024,6 +1048,8 @@ export const settingsAPI = {
|
||||
deleteAdminApiKey,
|
||||
getOverloadCooldownSettings,
|
||||
updateOverloadCooldownSettings,
|
||||
getRateLimit429CooldownSettings,
|
||||
updateRateLimit429CooldownSettings,
|
||||
getStreamTimeoutSettings,
|
||||
updateStreamTimeoutSettings,
|
||||
getRectifierSettings,
|
||||
|
||||
Reference in New Issue
Block a user