diff --git a/internal/data/repoimpl/product.go b/internal/data/repoimpl/product.go index c5a9fdd..871bab7 100644 --- a/internal/data/repoimpl/product.go +++ b/internal/data/repoimpl/product.go @@ -68,11 +68,11 @@ func (r *ProductRepoImpl) GetByPNO(ctx context.Context, PNO string) (*bo.Product item, err = r.getByPNO(ctx, item, PNO) b, err := json.Marshal(item) - if err == nil { - r.rdb.Rdb.Set(ctx, c.Key, string(b), c.TTL) + if err != nil { + return err } - return err + return r.rdb.Rdb.Set(ctx, c.Key, string(b), c.TTL).Err() }) if err != nil {