perf: SQLite WAL + 复合索引 + GZip + scheduler jitter + 构建缓存

This commit is contained in:
SmartUp Developer
2026-05-25 00:08:10 +08:00
parent 3a31d185a4
commit 41a439d830
10 changed files with 77 additions and 8 deletions
+5 -1
View File
@@ -1,6 +1,6 @@
from datetime import datetime, timezone
from typing import Optional
from sqlalchemy import Integer, String, Boolean, DateTime, Text, Float
from sqlalchemy import Index, Integer, String, Boolean, DateTime, Text, Float
from sqlalchemy.orm import mapped_column, Mapped
from app.database import Base
@@ -36,3 +36,7 @@ class Upstream(Base):
updated_at: Mapped[datetime] = mapped_column(
DateTime, default=lambda: datetime.now(timezone.utc), onupdate=lambda: datetime.now(timezone.utc)
)
__table_args__ = (
Index("ix_upstream_enabled", "enabled"),
)