more fancy features

This commit is contained in:
2025-11-26 18:35:08 +01:00
parent 28c9a24dac
commit 51b30de2d8
5 changed files with 128 additions and 20 deletions
+2 -2
View File
@@ -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