rcmaples / shftr

0 stars 0 forks source link

emptyOfflineQueue runs quicker than setOnline and finishes first. @rcmaples #2

Closed rcmaples closed 3 years ago

rcmaples commented 3 years ago

emptyOfflineQueue ends up completing before setOnline so when a user comes on at 8am and there are tickets waiting, they don't get assigned until the next pass 15 minutes later. Possible solutions: move into it's own cron with a different timing or use setTimeout() to introduce a delay on this function. A few seconds should be sufficient, can probably wait a full minute for safety though.

https://github.com/rcmaples/shftr/blob/d9da3f5bafdd3378f1c55702180bd2b0c8fc9d6a/server.js#L68-L68