Closed matdavies closed 3 years ago
Looks good @matdavies ! Sorry realise I missed one more - should the lock also apply to all other endpoints that operate on that UUID, e.g. ProcessCheckpoint
(to protect leasing overlaps?), and cancellation, etc? Basically to avoid any unexpected behaviour where a UUID get operated on more than once, through whichever endpoint?
Specifically that would be in each of the "write" endpoints defined in the IBookingEngine
interface:
Note that for ProcessCheckpoint1
and ProcessCheckpoint2
the lock can be simply added to ProcessCheckpoint
Hi @nickevansuk , have added locks to all write endpoints except TriggerTestAction
, because in that case I was not sure what the key should be. If you let me know a sensible key there, I will add.
Related to #100
Adds AsyncDuplicateLock, which was copied from Steven Cleary's answer to this SO question. We've used this for years to prevent the same situation in callbacks from POS webhooks or Payment Gateway callbacks, so confident in its functionality. Though, I appreciate, there are no tests here...