Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,16 @@ PROBE_INTERVAL_MS=30000
PROBE_TIMEOUT_MS=5000

# Provider Endpoint Probing (always enabled)
# 功能说明:每 10 秒探测所有启用端点的速度与连通性,并刷新端点选择排序。
# 注意:没有 ENABLE 开关,默认启用;可通过下列参数调优。
ENDPOINT_PROBE_INTERVAL_MS=10000
# Probes all enabled endpoints based on dynamic intervals and refreshes endpoint selection ranking.
# Note: No ENABLE switch, enabled by default; tune via parameters below.
#
# Dynamic Interval Rules (in priority order):
# 1. Timeout Override (10s): If endpoint's lastProbeErrorType === "timeout" and not recovered (lastProbeOk !== true)
# 2. Single-Vendor (10min): If vendor has only 1 enabled endpoint
# 3. Base Interval (default): All other endpoints
#
# ENDPOINT_PROBE_INTERVAL_MS controls the base interval. Single-vendor and timeout intervals are fixed.
ENDPOINT_PROBE_INTERVAL_MS=60000
ENDPOINT_PROBE_TIMEOUT_MS=5000
ENDPOINT_PROBE_CONCURRENCY=10
ENDPOINT_PROBE_CYCLE_JITTER_MS=1000
Expand Down
6 changes: 6 additions & 0 deletions drizzle/0048_add_system_timezone.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Add timezone column to system_settings table
-- Stores IANA timezone identifier (e.g., 'Asia/Shanghai', 'America/New_York')
-- NULL means: use TZ environment variable or fallback to UTC

ALTER TABLE "system_settings"
ADD COLUMN IF NOT EXISTS "timezone" varchar(64);
6 changes: 6 additions & 0 deletions drizzle/0057_conscious_quicksilver.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ALTER TABLE "message_request" ALTER COLUMN "input_tokens" SET DATA TYPE bigint;--> statement-breakpoint
ALTER TABLE "message_request" ALTER COLUMN "output_tokens" SET DATA TYPE bigint;--> statement-breakpoint
ALTER TABLE "message_request" ALTER COLUMN "cache_creation_input_tokens" SET DATA TYPE bigint;--> statement-breakpoint
ALTER TABLE "message_request" ALTER COLUMN "cache_read_input_tokens" SET DATA TYPE bigint;--> statement-breakpoint
ALTER TABLE "message_request" ALTER COLUMN "cache_creation_5m_input_tokens" SET DATA TYPE bigint;--> statement-breakpoint
ALTER TABLE "message_request" ALTER COLUMN "cache_creation_1h_input_tokens" SET DATA TYPE bigint;
6 changes: 6 additions & 0 deletions drizzle/0058_silly_sleepwalker.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ALTER TABLE "system_settings" ADD COLUMN "quota_db_refresh_interval_seconds" integer DEFAULT 10;--> statement-breakpoint
ALTER TABLE "system_settings" ADD COLUMN "quota_lease_percent_5h" numeric(5, 4) DEFAULT '0.05';--> statement-breakpoint
ALTER TABLE "system_settings" ADD COLUMN "quota_lease_percent_daily" numeric(5, 4) DEFAULT '0.05';--> statement-breakpoint
ALTER TABLE "system_settings" ADD COLUMN "quota_lease_percent_weekly" numeric(5, 4) DEFAULT '0.05';--> statement-breakpoint
ALTER TABLE "system_settings" ADD COLUMN "quota_lease_percent_monthly" numeric(5, 4) DEFAULT '0.05';--> statement-breakpoint
ALTER TABLE "system_settings" ADD COLUMN "quota_lease_cap_usd" numeric(10, 2);
2 changes: 2 additions & 0 deletions drizzle/0059_safe_xorn.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "keys" ALTER COLUMN "expires_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
ALTER TABLE "system_settings" ADD COLUMN IF NOT EXISTS "timezone" varchar(64);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This ADD COLUMN statement is redundant as it's already present in the 0048_add_system_timezone.sql migration. While IF NOT EXISTS prevents an error, it's best to remove duplicate statements from migrations to keep them clean and avoid potential confusion. This might indicate a small issue in the migration generation process.

Loading
Loading