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:
2020-09-18 15:56:11 +02:00
committed by GitHub
parent 89557c89b7
commit b0b99ed921

View File

@@ -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()
}