feat: increase default timeout to 5 minutes

This commit is contained in:
Sakurasan
2026-08-31 16:56:18 +08:00
parent 658a9cb580
commit 5cb428bba9
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ func (h *Handler) AdminCreateChannel(c *gin.Context) {
Name: req.Name, Provider: req.Provider, Formats: formats, BaseURL: baseURL, Name: req.Name, Provider: req.Provider, Formats: formats, BaseURL: baseURL,
BaseURLs: normalizeBaseURLs(req.BaseURLs), BaseURLs: normalizeBaseURLs(req.BaseURLs),
APIKeyEnc: enc, Weight: intOr(req.Weight, 1), Priority: intOr(req.Priority, 0), 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), HealthStatus: store.ChannelHealthHealthy, Enabled: boolOr(req.Enabled, true),
} }
if err := h.a.DB.Create(&ch).Error; err != nil { if err := h.a.DB.Create(&ch).Error; err != nil {
+1 -1
View File
@@ -92,7 +92,7 @@ type Channel struct {
APIKeyEnc string `gorm:"size:1024;not null" json:"-"` // AES-GCM 密文 APIKeyEnc string `gorm:"size:1024;not null" json:"-"` // AES-GCM 密文
Weight int `gorm:"not null;default:1" json:"weight"` Weight int `gorm:"not null;default:1" json:"weight"`
Priority int `gorm:"not null;default:0" json:"priority"` // 数值小优先 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"` MaxConcurrency int `gorm:"not null;default:16" json:"max_concurrency"`
HealthStatus string `gorm:"size:16;not null;default:healthy" json:"health_status"` HealthStatus string `gorm:"size:16;not null;default:healthy" json:"health_status"`
Enabled bool `gorm:"not null;default:true" json:"enabled"` Enabled bool `gorm:"not null;default:true" json:"enabled"`
+2 -2
View File
@@ -31,7 +31,7 @@ const form = reactive({
api_key: '', api_key: '',
weight: 1, weight: 1,
priority: 0, priority: 0,
timeout_ms: 120000, timeout_ms: 300000,
max_concurrency: 16, max_concurrency: 16,
enabled: true, enabled: true,
}) })
@@ -51,7 +51,7 @@ function openCreate() {
name: '', formats: ['chat'], base_url: '', name: '', formats: ['chat'], base_url: '',
base_urls: { chat: '', responses: '', messages: '' }, base_urls: { chat: '', responses: '', messages: '' },
api_key: '', 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 editOpen.value = true
} }