fix(knowledge): recover tasks safely after server restart

Stop failing distributed-mode knowledge rows on startup; let housekeeping
decide using span activity and Asynq queue state. In Lite mode, resume
wiki work from durable task_pending_ops and surface SERVER_RESTART errors
in the processing timeline with i18n support.
This commit is contained in:
wizardchen
2026-07-14 17:20:22 +08:00
committed by lyingbug
parent 28ebcf2525
commit ace84bc757
12 changed files with 462 additions and 74 deletions
+5
View File
@@ -390,6 +390,11 @@ func BuildContainer(container *dig.Container) *dig.Container {
} else {
must(container.Invoke(router.RegisterSyncHandlers))
}
// Wiki operation rows are durable, while their wake-up triggers may be
// lost across a process restart (always in Lite mode, and in Redis mode if
// persistence succeeded immediately before trigger enqueue failed). Re-arm
// them only after the matching handlers are ready.
must(container.Invoke(recoverPendingWikiTasks))
logger.Infof(ctx, "[Container] Container initialization completed successfully")
return container