Concurrency control in Strapi

I dont have any bugs with confict data right now but i wanna know what if we have this situation:
A and B are users. They want to get access to telescope. If telescope is free user can get access and telescope becomes busy. All works fine if:

    • User A send get request →
    • Telescope availiable
    • A send post request and change telescope status →
    • Telescope becomes busy
    • User B send get request →
    • Telescope is busy, try of access to telescope regected

But if users press “get access to telescope” button at the same time:

  1. User A send get request →
  2. User B send get request →
  3. Telescope availiable (for user A)
    B get request is already in node.js event loop →
  4. Telescope availiable (for user B)
  5. A send post request and change telescope status →
  6. Telescope becomes busy
  7. B send post request and change telescope status →
  8. Telescope becomes busy (again)

How to deal with it?

1 Like

Dear @Sergei888
Did you find a solution to this problem?