perf: SQLite WAL + 复合索引 + GZip + scheduler jitter + 构建缓存
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime, timezone
|
||||
from typing import Optional
|
||||
|
||||
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, String, Text
|
||||
from sqlalchemy import Boolean, DateTime, ForeignKey, Index, Integer, String, Text, text
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from app.database import Base
|
||||
@@ -66,3 +66,8 @@ class WebsiteSyncLog(Base):
|
||||
status: Mapped[str] = mapped_column(String(16), nullable=False)
|
||||
message: Mapped[str] = mapped_column(Text, default="")
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime, default=lambda: datetime.now(timezone.utc), index=True)
|
||||
|
||||
__table_args__ = (
|
||||
Index("ix_sync_website_created", "website_id", text("created_at DESC")),
|
||||
Index("ix_sync_binding_created", "binding_id", text("created_at DESC")),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user