Prevent simultaneous order updates
Last modified:
If you are experiencing issues where the same order is confirmed multiple times due to simultaneous requests, for example causing stock to be reduced more than once, you can enable an atomic lock during the order confirmation process.
This helps prevent race conditions where multiple processes attempt to update the same order at the same time.
To enable this behavior, add the following filter:
add_filter( 'dintero_wc_lock_confirmation', '__return_true' );When enabled, the plugin ensures that only one confirmation process can update a specific order at a time.
When to use this:
- Orders are updated multiple times unexpectedly
- You see duplicate processing or inconsistent order states
- You suspect multiple callbacks are being handled simultaneously