@@ -602,6 +602,7 @@ func (db *DB) migrate(ctx context.Context) error {
602602 auto_clean_rate_limited BOOLEAN DEFAULT FALSE,
603603 background_refresh_interval_minutes INT DEFAULT 2,
604604 usage_probe_max_age_minutes INT DEFAULT 10,
605+ usage_probe_concurrency INT DEFAULT 16,
605606 recovery_probe_interval_minutes INT DEFAULT 30,
606607 scheduler_mode VARCHAR(20) DEFAULT 'round_robin'
607608 );
@@ -633,6 +634,7 @@ func (db *DB) migrate(ctx context.Context) error {
633634 ALTER TABLE system_settings ADD COLUMN IF NOT EXISTS model_mapping TEXT DEFAULT '{}';
634635 ALTER TABLE system_settings ADD COLUMN IF NOT EXISTS background_refresh_interval_minutes INT DEFAULT 2;
635636 ALTER TABLE system_settings ADD COLUMN IF NOT EXISTS usage_probe_max_age_minutes INT DEFAULT 10;
637+ ALTER TABLE system_settings ADD COLUMN IF NOT EXISTS usage_probe_concurrency INT DEFAULT 16;
636638 ALTER TABLE system_settings ADD COLUMN IF NOT EXISTS recovery_probe_interval_minutes INT DEFAULT 30;
637639 ALTER TABLE system_settings ADD COLUMN IF NOT EXISTS scheduler_mode VARCHAR(20) DEFAULT 'round_robin';
638640 ALTER TABLE system_settings ADD COLUMN IF NOT EXISTS affinity_mode VARCHAR(16) DEFAULT 'bounded';
@@ -1168,6 +1170,7 @@ type SystemSettings struct {
11681170 ModelMapping string // JSON: {"anthropic_model": "codex_model", ...}
11691171 BackgroundRefreshIntervalMinutes int
11701172 UsageProbeMaxAgeMinutes int
1173+ UsageProbeConcurrency int
11711174 RecoveryProbeIntervalMinutes int
11721175 SchedulerMode string
11731176 AffinityMode string // session 粘性模式: bounded / off / strict
@@ -1210,6 +1213,7 @@ func (db *DB) GetSystemSettings(ctx context.Context) (*SystemSettings, error) {
12101213 COALESCE(model_mapping, '{}'),
12111214 COALESCE(background_refresh_interval_minutes, 2),
12121215 COALESCE(usage_probe_max_age_minutes, 10),
1216+ COALESCE(usage_probe_concurrency, 16),
12131217 COALESCE(recovery_probe_interval_minutes, 30),
12141218 COALESCE(scheduler_mode, 'round_robin'),
12151219 COALESCE(affinity_mode, 'bounded'),
@@ -1239,7 +1243,7 @@ func (db *DB) GetSystemSettings(ctx context.Context) (*SystemSettings, error) {
12391243 & s .AutoCleanUnauthorized , & s .AutoCleanRateLimited , & s .AdminSecret , & s .AutoCleanFullUsage ,
12401244 & s .ProxyPoolEnabled , & s .FastSchedulerEnabled , & s .MaxRetries , & s .MaxRateLimitRetries , & s .AllowRemoteMigration ,
12411245 & s .AutoCleanError , & s .AutoCleanExpired , & s .LazyMode , & s .ModelMapping ,
1242- & s .BackgroundRefreshIntervalMinutes , & s .UsageProbeMaxAgeMinutes , & s .RecoveryProbeIntervalMinutes ,
1246+ & s .BackgroundRefreshIntervalMinutes , & s .UsageProbeMaxAgeMinutes , & s .UsageProbeConcurrency , & s . RecoveryProbeIntervalMinutes ,
12431247 & s .SchedulerMode ,
12441248 & s .AffinityMode ,
12451249 & s .ResinURL , & s .ResinPlatformName ,
@@ -1266,6 +1270,7 @@ func (db *DB) UpdateSystemSettings(ctx context.Context, s *SystemSettings) error
12661270 auto_clean_unauthorized, auto_clean_rate_limited, admin_secret, auto_clean_full_usage, proxy_pool_enabled,
12671271 fast_scheduler_enabled, max_retries, max_rate_limit_retries, allow_remote_migration, auto_clean_error, auto_clean_expired, lazy_mode, model_mapping,
12681272 background_refresh_interval_minutes, usage_probe_max_age_minutes, recovery_probe_interval_minutes,
1273+ usage_probe_concurrency,
12691274 resin_url, resin_platform_name, prompt_filter_enabled, prompt_filter_mode, prompt_filter_threshold,
12701275 prompt_filter_strict_threshold, prompt_filter_log_matches, prompt_filter_max_text_length,
12711276 prompt_filter_sensitive_words, prompt_filter_custom_patterns, prompt_filter_disabled_patterns,
@@ -1275,7 +1280,7 @@ func (db *DB) UpdateSystemSettings(ctx context.Context, s *SystemSettings) error
12751280 scheduler_mode,
12761281 affinity_mode
12771282 )
1278- VALUES (1, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45, $46)
1283+ VALUES (1, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45, $46, $47 )
12791284 ON CONFLICT (id) DO UPDATE SET
12801285 site_name = EXCLUDED.site_name,
12811286 site_logo = EXCLUDED.site_logo,
@@ -1301,6 +1306,7 @@ func (db *DB) UpdateSystemSettings(ctx context.Context, s *SystemSettings) error
13011306 model_mapping = EXCLUDED.model_mapping,
13021307 background_refresh_interval_minutes = EXCLUDED.background_refresh_interval_minutes,
13031308 usage_probe_max_age_minutes = EXCLUDED.usage_probe_max_age_minutes,
1309+ usage_probe_concurrency = EXCLUDED.usage_probe_concurrency,
13041310 recovery_probe_interval_minutes = EXCLUDED.recovery_probe_interval_minutes,
13051311 resin_url = EXCLUDED.resin_url,
13061312 resin_platform_name = EXCLUDED.resin_platform_name,
@@ -1328,6 +1334,7 @@ func (db *DB) UpdateSystemSettings(ctx context.Context, s *SystemSettings) error
13281334 s .AutoCleanUnauthorized , s .AutoCleanRateLimited , s .AdminSecret , s .AutoCleanFullUsage , s .ProxyPoolEnabled ,
13291335 s .FastSchedulerEnabled , s .MaxRetries , s .MaxRateLimitRetries , s .AllowRemoteMigration , s .AutoCleanError , s .AutoCleanExpired , s .LazyMode , s .ModelMapping ,
13301336 s .BackgroundRefreshIntervalMinutes , s .UsageProbeMaxAgeMinutes , s .RecoveryProbeIntervalMinutes ,
1337+ s .UsageProbeConcurrency ,
13311338 s .ResinURL , s .ResinPlatformName , s .PromptFilterEnabled , s .PromptFilterMode , s .PromptFilterThreshold ,
13321339 s .PromptFilterStrictThreshold , s .PromptFilterLogMatches , s .PromptFilterMaxTextLength ,
13331340 s .PromptFilterSensitiveWords , s .PromptFilterCustomPatterns , s .PromptFilterDisabledPatterns ,
0 commit comments