Domanda

I'm struggling to come up with a solution for events ticket booking system. I need some idea how to lock a ticket once added to 'a cart' so it cannot be booked by other customer

How is this done on other ticket booking sites where the ticket is reserved for eg 10 minutes and then gets released after that time when transaction is not completed. Running cron job every minute wouldn't be viable, would it?

È stato utile?

Soluzione

If you save the time when the ticket is to be unlocked and then when someone wants to book it you just have to see if that time has passed, it should work without any trouble or stress to the server.

So in your ticket table you add a datetime field named 'booked_until', store the time when the item is going to get unlocked and you are set!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top