Fixed timeout for SMS response 1 min to 10 minutes
Error where timeout was set to a single minute. Forgot to update from testing. Now made timeout a bit more clear and added log message.
This commit is contained in:
@@ -157,7 +157,11 @@ const sendNotificationToWinnerById = async (req, res) => {
|
||||
}
|
||||
|
||||
function startTimeout(id) {
|
||||
const minute = 60000;
|
||||
const minutesForTimeout = 10;
|
||||
|
||||
console.log(`Starting timeout for user ${id}.`);
|
||||
console.log(`Timeout duration: ${ minutesForTimeout * minute }`
|
||||
setTimeout(async () => {
|
||||
let virtualWinner = await VirtualWinner.findOne({ id: id });
|
||||
if (!virtualWinner) {
|
||||
@@ -174,7 +178,7 @@ function startTimeout(id) {
|
||||
await virtualWinner.save();
|
||||
|
||||
findAndNotifyNextWinner();
|
||||
}, 60000);
|
||||
}, minutesForTimeout * minute);
|
||||
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user