mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-10 11:42:27 +08:00
fix: 统一端点默认重试次数为 2
同步前端表单、mock 数据和后端导入配置中端点的默认重试次数
This commit is contained in:
@@ -296,7 +296,7 @@ const form = ref({
|
|||||||
base_url: '',
|
base_url: '',
|
||||||
custom_path: '',
|
custom_path: '',
|
||||||
timeout: 300,
|
timeout: 300,
|
||||||
max_retries: 3,
|
max_retries: 2,
|
||||||
max_concurrent: undefined as number | undefined,
|
max_concurrent: undefined as number | undefined,
|
||||||
rate_limit: undefined as number | undefined,
|
rate_limit: undefined as number | undefined,
|
||||||
is_active: true,
|
is_active: true,
|
||||||
@@ -392,7 +392,7 @@ function resetForm() {
|
|||||||
base_url: '',
|
base_url: '',
|
||||||
custom_path: '',
|
custom_path: '',
|
||||||
timeout: 300,
|
timeout: 300,
|
||||||
max_retries: 3,
|
max_retries: 2,
|
||||||
max_concurrent: undefined,
|
max_concurrent: undefined,
|
||||||
rate_limit: undefined,
|
rate_limit: undefined,
|
||||||
is_active: true,
|
is_active: true,
|
||||||
|
|||||||
@@ -425,9 +425,9 @@ const MOCK_ENDPOINT_KEYS = [
|
|||||||
|
|
||||||
// Mock Endpoints
|
// Mock Endpoints
|
||||||
const MOCK_ENDPOINTS = [
|
const MOCK_ENDPOINTS = [
|
||||||
{ id: 'ep-001', provider_id: 'provider-001', provider_name: 'anthropic', api_format: 'claude', base_url: 'https://api.anthropic.com', auth_type: 'bearer', timeout: 120, max_retries: 3, priority: 100, weight: 100, health_score: 98, consecutive_failures: 0, is_active: true, total_keys: 2, active_keys: 2, created_at: '2024-01-01T00:00:00Z', updated_at: new Date().toISOString() },
|
{ id: 'ep-001', provider_id: 'provider-001', provider_name: 'anthropic', api_format: 'claude', base_url: 'https://api.anthropic.com', auth_type: 'bearer', timeout: 120, max_retries: 2, priority: 100, weight: 100, health_score: 98, consecutive_failures: 0, is_active: true, total_keys: 2, active_keys: 2, created_at: '2024-01-01T00:00:00Z', updated_at: new Date().toISOString() },
|
||||||
{ id: 'ep-002', provider_id: 'provider-002', provider_name: 'openai', api_format: 'openai', base_url: 'https://api.openai.com', auth_type: 'bearer', timeout: 60, max_retries: 3, priority: 90, weight: 100, health_score: 97, consecutive_failures: 0, is_active: true, total_keys: 1, active_keys: 1, created_at: '2024-01-01T00:00:00Z', updated_at: new Date().toISOString() },
|
{ id: 'ep-002', provider_id: 'provider-002', provider_name: 'openai', api_format: 'openai', base_url: 'https://api.openai.com', auth_type: 'bearer', timeout: 60, max_retries: 2, priority: 90, weight: 100, health_score: 97, consecutive_failures: 0, is_active: true, total_keys: 1, active_keys: 1, created_at: '2024-01-01T00:00:00Z', updated_at: new Date().toISOString() },
|
||||||
{ id: 'ep-003', provider_id: 'provider-003', provider_name: 'google', api_format: 'gemini', base_url: 'https://generativelanguage.googleapis.com', auth_type: 'api_key', timeout: 60, max_retries: 3, priority: 80, weight: 100, health_score: 96, consecutive_failures: 0, is_active: true, total_keys: 1, active_keys: 1, created_at: '2024-01-15T00:00:00Z', updated_at: new Date().toISOString() }
|
{ id: 'ep-003', provider_id: 'provider-003', provider_name: 'google', api_format: 'gemini', base_url: 'https://generativelanguage.googleapis.com', auth_type: 'api_key', timeout: 60, max_retries: 2, priority: 80, weight: 100, health_score: 96, consecutive_failures: 0, is_active: true, total_keys: 1, active_keys: 1, created_at: '2024-01-15T00:00:00Z', updated_at: new Date().toISOString() }
|
||||||
]
|
]
|
||||||
|
|
||||||
// Mock 能力定义
|
// Mock 能力定义
|
||||||
@@ -1224,7 +1224,7 @@ function generateMockEndpointsForProvider(providerId: string) {
|
|||||||
'https://generativelanguage.googleapis.com',
|
'https://generativelanguage.googleapis.com',
|
||||||
auth_type: format.includes('GEMINI') ? 'api_key' : 'bearer',
|
auth_type: format.includes('GEMINI') ? 'api_key' : 'bearer',
|
||||||
timeout: 120,
|
timeout: 120,
|
||||||
max_retries: 3,
|
max_retries: 2,
|
||||||
priority: 100 - index * 10,
|
priority: 100 - index * 10,
|
||||||
weight: 100,
|
weight: 100,
|
||||||
health_score: healthDetail?.health_score ?? 1.0,
|
health_score: healthDetail?.health_score ?? 1.0,
|
||||||
|
|||||||
@@ -887,7 +887,7 @@ class AdminImportConfigAdapter(AdminApiAdapter):
|
|||||||
)
|
)
|
||||||
existing_ep.headers = ep_data.get("headers")
|
existing_ep.headers = ep_data.get("headers")
|
||||||
existing_ep.timeout = ep_data.get("timeout", 300)
|
existing_ep.timeout = ep_data.get("timeout", 300)
|
||||||
existing_ep.max_retries = ep_data.get("max_retries", 3)
|
existing_ep.max_retries = ep_data.get("max_retries", 2)
|
||||||
existing_ep.max_concurrent = ep_data.get("max_concurrent")
|
existing_ep.max_concurrent = ep_data.get("max_concurrent")
|
||||||
existing_ep.rate_limit = ep_data.get("rate_limit")
|
existing_ep.rate_limit = ep_data.get("rate_limit")
|
||||||
existing_ep.is_active = ep_data.get("is_active", True)
|
existing_ep.is_active = ep_data.get("is_active", True)
|
||||||
@@ -903,7 +903,7 @@ class AdminImportConfigAdapter(AdminApiAdapter):
|
|||||||
base_url=ep_data["base_url"],
|
base_url=ep_data["base_url"],
|
||||||
headers=ep_data.get("headers"),
|
headers=ep_data.get("headers"),
|
||||||
timeout=ep_data.get("timeout", 300),
|
timeout=ep_data.get("timeout", 300),
|
||||||
max_retries=ep_data.get("max_retries", 3),
|
max_retries=ep_data.get("max_retries", 2),
|
||||||
max_concurrent=ep_data.get("max_concurrent"),
|
max_concurrent=ep_data.get("max_concurrent"),
|
||||||
rate_limit=ep_data.get("rate_limit"),
|
rate_limit=ep_data.get("rate_limit"),
|
||||||
is_active=ep_data.get("is_active", True),
|
is_active=ep_data.get("is_active", True),
|
||||||
|
|||||||
Reference in New Issue
Block a user