more fancy features
This commit is contained in:
@@ -66,7 +66,7 @@ func (s *RedisInventoryService) GetInventoryBatch(ctx context.Context, refs ...*
|
||||
pipe := s.client.Pipeline()
|
||||
cmds := make([]*redis.StringCmd, len(refs))
|
||||
for i, ref := range refs {
|
||||
key := getInventoryKey(ref.Sku, ref.LocationID)
|
||||
key := getInventoryKey(ref.SKU, ref.LocationID)
|
||||
cmds[i] = pipe.Get(ctx, key)
|
||||
}
|
||||
_, err := pipe.Exec(ctx)
|
||||
@@ -139,7 +139,7 @@ func makeKeysAndArgs(req ...ReserveRequest) ([]string, []string) {
|
||||
if r.Quantity <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
keys[i] = getInventoryKey(r.Sku, r.LocationID)
|
||||
keys[i] = getInventoryKey(r.SKU, r.LocationID)
|
||||
args[i] = strconv.Itoa(int(r.Quantity))
|
||||
}
|
||||
return keys, args
|
||||
|
||||
Reference in New Issue
Block a user