removed filter to get all tenders - bug fix
This commit is contained in:
@@ -39,9 +39,10 @@ func (w *DocumentSummarizationWorker) Run() {
|
||||
w.Logger.Info("Document summarization worker started", map[string]interface{}{})
|
||||
|
||||
limit := 5 // Process fewer tenders at a time since summarization is resource-intensive
|
||||
skip := 0
|
||||
for {
|
||||
tenders, totalCount, err := w.TenderRepo.GetUnSummarizedTenders(context.Background(), limit, skip)
|
||||
// Always use skip=0 because processed items are excluded by the filter,
|
||||
// so incrementing skip would cause unprocessed items to be skipped.
|
||||
tenders, totalCount, err := w.TenderRepo.GetUnSummarizedTenders(context.Background(), limit, 0)
|
||||
if err != nil {
|
||||
w.Logger.Error("Failed to get un-summarized tenders", map[string]interface{}{
|
||||
"error": err.Error(),
|
||||
@@ -52,7 +53,6 @@ func (w *DocumentSummarizationWorker) Run() {
|
||||
w.Logger.Info("Found tenders for document summarization", map[string]interface{}{
|
||||
"count": len(tenders),
|
||||
"total_count": totalCount,
|
||||
"skip": skip,
|
||||
})
|
||||
|
||||
if len(tenders) == 0 {
|
||||
@@ -69,8 +69,6 @@ func (w *DocumentSummarizationWorker) Run() {
|
||||
|
||||
w.summarizeDocumentsForTender(&t)
|
||||
}
|
||||
|
||||
skip += limit
|
||||
}
|
||||
|
||||
w.Logger.Info("Document summarization worker completed", map[string]interface{}{})
|
||||
|
||||
Reference in New Issue
Block a user