removed filter to get all tenders - bug fix

This commit is contained in:
Mazyar
2026-05-04 05:28:56 +03:30
parent 446c11dfbf
commit 086fe0ffd5
7 changed files with 31 additions and 20 deletions
+3 -5
View File
@@ -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{}{})