feat: add historical news AI backfill and visible task queue
Development CI / check-and-build (push) Successful in 2m44s
GitHub Git mirror / mirror (push) Successful in 6s
Development CI / deploy-development (push) Failing after 7s

Freeze date-range previews and model settings, track per-news progress and downstream targets, and share completion-driven scheduling with realtime analysis.

Prevent overlapping retries for the same news, retain batch queue associations, and refresh selected details with session-safe pagination.
This commit is contained in:
eezd committed 2026-11-01 14:47:54 +08:00
1 parent cbd2618a20
commit b45981ec30
25 files changed
+1339 -39

No files matched your search

+24
View File
@@ -224,3 +224,27 @@ class EventLink(Base):
event_id: Mapped[int] = mapped_column(ForeignKey('news_ai_events.id'), primary_key=True)
reason: Mapped[str] = mapped_column(Text)
package_revision: Mapped[int] = mapped_column(Integer)
class ReprocessItem(Base):
__tablename__ = 'news_ai_reprocess_items'
__table_args__ = (UniqueConstraint('job_id', 'news_id'),)
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
job_id: Mapped[int] = mapped_column(ForeignKey('news_ai_reprocess_jobs.id'), index=True)
news_id: Mapped[int] = mapped_column(ForeignKey('news_items.id'), index=True)
content_hash: Mapped[str] = mapped_column(String(64))
mode: Mapped[str] = mapped_column(String(16))
state: Mapped[str] = mapped_column(String(16), default='pending', index=True)
error: Mapped[str | None] = mapped_column(Text)
started_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True))
finished_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True))
class ReprocessTarget(Base):
__tablename__ = 'news_ai_reprocess_targets'
__table_args__ = (UniqueConstraint('job_id', 'kind', 'object_id'),)
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
job_id: Mapped[int] = mapped_column(ForeignKey('news_ai_reprocess_jobs.id'), index=True)
kind: Mapped[str] = mapped_column(String(16))
object_id: Mapped[int] = mapped_column(BigInteger)
revision: Mapped[int] = mapped_column(Integer)