fix: 已学完的课不再重查,连续失败会退避

This commit is contained in:
2026-11-16 09:01:47 +08:00
parent f42633b5ad
commit 174d7a49e3
5 changed files with 160 additions and 13 deletions
+11
View File
@@ -36,6 +36,17 @@ class CourseSync(Base):
course_count: Mapped[int] = mapped_column(nullable=False, default=0)
class FinishedCourse(Base):
"""已经确认学完的课。重启后不再重复查询。"""
__tablename__ = "finished_courses"
__table_args__ = (UniqueConstraint("employee_id", "knowledge_id", name="uq_finished_course"),)
id: Mapped[int] = mapped_column(primary_key=True)
employee_id: Mapped[str] = mapped_column(String(64), nullable=False)
knowledge_id: Mapped[str] = mapped_column(String(64), nullable=False, default="", server_default="")
class Account(Base):
__tablename__ = "accounts"