Skip to content

Commit

Permalink
fix: locking keys in compensation
Browse files Browse the repository at this point in the history
  • Loading branch information
fPolic committed Feb 11, 2025
1 parent 66c76b7 commit c1c8ed7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/core-flows/src/cart/steps/reserve-inventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export const reserveInventoryStep = createStep(
const locking = container.resolve(Modules.LOCKING)

const inventoryItemIds = data.inventoryItemIds
await locking.execute(inventoryItemIds, async () => {
const lockingKeys = Array.from(new Set(inventoryItemIds))

await locking.execute(lockingKeys, async () => {
await inventoryService.deleteReservationItems(data.reservations)
})

Expand Down

0 comments on commit c1c8ed7

Please sign in to comment.