Below are my ideas (broken rather):
-
relying on
setTimeout
, but my users are in different time zone so assuming this won’t be the best way of doing it.setTimeout(() => { // disable ticket }, timeToDisable);
-
using node-schedule : With this approach the scheduler will be running on the node server so should I make a network call to request time every second? That sure doesn’t sound right to me as well.
schedule.scheduleJob('00 15 * * *', () => { disableTickets(ticketsToDisable); console.log(`Tickets disabled ${ticketsToDisable}`); });
What’s a good way of doing this?