Merge pull request #131 from unihon/fix/provider-health

fix(usage): 修复provider_health接口过滤参数不生效问题
This commit is contained in:
何夕2077 2025-12-23 18:52:53 +08:00 committed by GitHub
commit 531b9af1e0

View file

@ -72,7 +72,7 @@ export function createRequestHandler(config, providerPoolManager) {
const customName = requestUrl.searchParams.get('customName');
let unhealthRatioThreshold = requestUrl.searchParams.get('unhealthRatioThreshold');
unhealthRatioThreshold = unhealthRatioThreshold === null ? 0.0001 : parseFloat(unhealthRatioThreshold);
let provideStatus = await getProviderStatus(currentConfig, null, { provider, customName });
let provideStatus = await getProviderStatus(currentConfig, { provider, customName });
let summaryHealth = true;
if (!isNaN(unhealthRatioThreshold)) {
summaryHealth = provideStatus.unhealthyRatio <= unhealthRatioThreshold;