concat 3 times of contact list
This commit is contained in:
+1
-4
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user