feat: refactor product attributes caching logic and add HashArray utility function
This commit is contained in:
@@ -95,7 +95,8 @@ func fetchProducts(
|
||||
}
|
||||
|
||||
func (a apiRepository) StreamAllProductsCache(ctx context.Context, marketplaceId int, resultChan chan<- []pb.Product, errChan chan<- error) {
|
||||
// DO NOT close channels here - WithCache will handle it (caller/creator owns them)
|
||||
defer close(resultChan)
|
||||
defer close(errChan)
|
||||
mp, err := a.marketplaceRepository.GetMarketplaceByID(ctx, marketplaceId)
|
||||
if err != nil {
|
||||
errChan <- fmt.Errorf("getting marketplace by ID: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user