feat: add condition to store offers only if they meet 90% of requested count
This commit is contained in:
@@ -121,6 +121,10 @@ func (r *apiRepository) GetProducts(ctx context.Context, marketplaceID int, req
|
||||
// all offers
|
||||
var allOffers []*pb.GetProductsResponse_Offer
|
||||
defer func() {
|
||||
// store only if offers is 90% or more then requested
|
||||
if len(allOffers) < int(float64(len(req.OfferIds))*0.9) {
|
||||
return
|
||||
}
|
||||
if len(allOffers) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user