concat 3 times of contact list

This commit is contained in:
2022-11-10 12:01:20 +01:00
parent dbf36405df
commit 093a5e22ae
2 changed files with 2 additions and 5 deletions
+1 -4
View File
@@ -21,9 +21,6 @@ async function filterAlreadyBookedContacts(contactList) {
return contactsToBook; return contactsToBook;
} }
// Connect to the device.
async function needToBook(contact, mongoManager) { async function needToBook(contact, mongoManager) {
console.log("check contact with email " + contact.mail) console.log("check contact with email " + contact.mail)
let alreadyBooked = await mongoManager.getAllSuccessfulItemsForDay(collectionName); let alreadyBooked = await mongoManager.getAllSuccessfulItemsForDay(collectionName);
@@ -78,7 +75,7 @@ async function startBook(contactPojo, device, selectedStore, audioAnalyse, alert
} }
async function startWithList(contacts, device, selectedStore, audioAnalyse, alertBeep) { async function startWithList(contacts, device, selectedStore, audioAnalyse, alertBeep) {
let duplicatedList = [].concat(contacts).concat(contacts) let duplicatedList = [].concat(contacts).concat(contacts).concat(contacts)
await duplicatedList.reduce(async (promise, contactPojo) => { await duplicatedList.reduce(async (promise, contactPojo) => {
// This line will wait for the last async function to finish. // This line will wait for the last async function to finish.
// The first iteration uses an already resolved Promise // The first iteration uses an already resolved Promise
+1 -1
View File
@@ -78,7 +78,7 @@ class GeoCaptchaSolver {
await delay(2000 + getRandomWaitTime()); await delay(2000 + getRandomWaitTime());
} }
try { try {
if (number_list.isEmpty()) { if (number_list.length === 0) {
onResult(false) onResult(false)
} else { } else {
onResult(true) onResult(true)