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:
@@ -150,6 +150,16 @@ func TestKnowledgeSpansLastError_RecoveryFallbackUsesKnowledgeMessage(t *testing
|
||||
a.Equal(now, got["finished_at"])
|
||||
}
|
||||
|
||||
func TestKnowledgeSpansLastError_ClassifiesServerRestart(t *testing.T) {
|
||||
now := time.Now()
|
||||
got := knowledgeSpansLastError(2, 2, types.ParseStatusFailed,
|
||||
"Task interrupted due to application restart", now, nil)
|
||||
a := assert.New(t)
|
||||
a.NotNil(got)
|
||||
a.Equal("SERVER_RESTART", got["error_code"])
|
||||
a.Equal("SERVER_RESTART", got["code"])
|
||||
}
|
||||
|
||||
func TestKnowledgeSpansLastError_SkipsRecoveryFallbackForHistoricalAttempt(t *testing.T) {
|
||||
now := time.Now()
|
||||
got := knowledgeSpansLastError(1, 2, types.ParseStatusFailed, "wiki ingest timed out", now, nil)
|
||||
|
||||
Reference in New Issue
Block a user