From 5cb428bba9ac044a170755b15ed277577d4164d4 Mon Sep 17 00:00:00 2001 From: Sakurasan <26715255+Sakurasan@users.noreply.github.com> Date: Mon, 31 Aug 2026 16:56:18 +0800 Subject: [PATCH] feat: increase default timeout to 5 minutes --- server/internal/api/admin_channels.go | 2 +- server/internal/store/models.go | 2 +- web/src/views/admin/ChannelsView.vue | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/internal/api/admin_channels.go b/server/internal/api/admin_channels.go index ee9dd2c..0bbbce5 100644 --- a/server/internal/api/admin_channels.go +++ b/server/internal/api/admin_channels.go @@ -184,7 +184,7 @@ func (h *Handler) AdminCreateChannel(c *gin.Context) { Name: req.Name, Provider: req.Provider, Formats: formats, BaseURL: baseURL, BaseURLs: normalizeBaseURLs(req.BaseURLs), APIKeyEnc: enc, Weight: intOr(req.Weight, 1), Priority: intOr(req.Priority, 0), - TimeoutMS: intOr(req.TimeoutMS, 120000), MaxConcurrency: intOr(req.MaxConcurrency, 16), + TimeoutMS: intOr(req.TimeoutMS, 300000), MaxConcurrency: intOr(req.MaxConcurrency, 16), HealthStatus: store.ChannelHealthHealthy, Enabled: boolOr(req.Enabled, true), } if err := h.a.DB.Create(&ch).Error; err != nil { diff --git a/server/internal/store/models.go b/server/internal/store/models.go index 6c61e19..55c36c5 100644 --- a/server/internal/store/models.go +++ b/server/internal/store/models.go @@ -92,7 +92,7 @@ type Channel struct { APIKeyEnc string `gorm:"size:1024;not null" json:"-"` // AES-GCM 密文 Weight int `gorm:"not null;default:1" json:"weight"` Priority int `gorm:"not null;default:0" json:"priority"` // 数值小优先 - TimeoutMS int `gorm:"not null;default:120000" json:"timeout_ms"` + TimeoutMS int `gorm:"not null;default:300000" json:"timeout_ms"` MaxConcurrency int `gorm:"not null;default:16" json:"max_concurrency"` HealthStatus string `gorm:"size:16;not null;default:healthy" json:"health_status"` Enabled bool `gorm:"not null;default:true" json:"enabled"` diff --git a/web/src/views/admin/ChannelsView.vue b/web/src/views/admin/ChannelsView.vue index a192320..ebeb87a 100644 --- a/web/src/views/admin/ChannelsView.vue +++ b/web/src/views/admin/ChannelsView.vue @@ -31,7 +31,7 @@ const form = reactive({ api_key: '', weight: 1, priority: 0, - timeout_ms: 120000, + timeout_ms: 300000, max_concurrency: 16, enabled: true, }) @@ -51,7 +51,7 @@ function openCreate() { name: '', formats: ['chat'], base_url: '', base_urls: { chat: '', responses: '', messages: '' }, api_key: '', - weight: 1, priority: 0, timeout_ms: 120000, max_concurrency: 16, enabled: true, + weight: 1, priority: 0, timeout_ms: 300000, max_concurrency: 16, enabled: true, }) editOpen.value = true }