cache translation in minio instead of mongo
This commit is contained in:
@@ -41,7 +41,6 @@ func collectionName() string {
|
||||
return "tenders"
|
||||
}
|
||||
|
||||
|
||||
// SearchPageResult is the paginated outcome of a tender search/list query.
|
||||
type SearchPageResult struct {
|
||||
Items []Tender
|
||||
@@ -544,29 +543,15 @@ func (r *tenderRepository) GetUnSummarizedTenders(ctx context.Context, limit, sk
|
||||
return result.Items, result.TotalCount, nil
|
||||
}
|
||||
|
||||
// GetUnTranslatedTenders retrieves tenders that don't have a translation for the given language yet.
|
||||
// GetUnTranslatedTenders returns tenders eligible for translation backfill.
|
||||
func (r *tenderRepository) GetUnTranslatedTenders(ctx context.Context, language string, limit, skip int) ([]Tender, int64, error) {
|
||||
translationKey := "translations." + language
|
||||
metadataKey := "processing_metadata.translated_data." + language
|
||||
_ = language
|
||||
|
||||
filter := bson.M{
|
||||
"notice_publication_id": bson.M{"$ne": ""},
|
||||
"contract_folder_id": bson.M{"$ne": ""},
|
||||
"title": bson.M{"$ne": ""},
|
||||
"description": bson.M{"$ne": ""},
|
||||
"$and": []bson.M{
|
||||
{
|
||||
"$or": []bson.M{
|
||||
{translationKey: bson.M{"$exists": false}},
|
||||
{translationKey: nil},
|
||||
},
|
||||
},
|
||||
{
|
||||
"$or": []bson.M{
|
||||
{metadataKey: bson.M{"$exists": false}},
|
||||
{metadataKey: bson.M{"$ne": "done"}},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
pagination := orm.Pagination{
|
||||
|
||||
Reference in New Issue
Block a user