Skip to content

Commit

Permalink
Do not stop indexer on RAG error
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Oct 24, 2024
1 parent 648396f commit 00d61ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions model/rag/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ func Index(inst *instance.Instance, logger logger.Logger, msg IndexMessage) erro
return nil
}

var errj error
for _, change := range feed.Results {
if err := callRAGIndexer(inst, msg.Doctype, change); err != nil {
logger.Warnf("Index error: %s", err)
return err
errj = errors.Join(errj, err)
}
}
_ = updateLastSequenceNumber(inst, msg.Doctype, feed.LastSeq)
Expand All @@ -65,7 +66,7 @@ func Index(inst *instance.Instance, logger logger.Logger, msg IndexMessage) erro
_ = pushJob(inst, msg.Doctype)
}

return nil
return errj
}

func callRAGIndexer(inst *instance.Instance, doctype string, change couchdb.Change) error {
Expand Down

0 comments on commit 00d61ad

Please sign in to comment.