do not duplicate contacts
This commit is contained in:
+4
-2
@@ -10,7 +10,8 @@ const SEVEN_DAYS_IN_S = 3600 * 24 * 7;
|
||||
const NINETY_DAYS_IN_S = 3600 * 24 * 30 * 3;
|
||||
let excelUtil = new ExcelUtil();
|
||||
let collectionName = formatDate(new Date())
|
||||
device_to_excludes = ["47e7e36b", "e30eb015"]
|
||||
// device_to_excludes = ["47e7e36b", "e30eb015"]
|
||||
device_to_excludes = ["47e7e36b"]
|
||||
|
||||
async function filterAlreadyBookedContacts(contactList) {
|
||||
let alreadyBookedContacts = await mongoManager.getAllSuccessfulItemsForDay(collectionName);
|
||||
@@ -123,7 +124,8 @@ async function startBook(contactPojo, device, selectedStore, audioAnalyse, alert
|
||||
}
|
||||
|
||||
async function startWithList(contacts, device, selectedStore, audioAnalyse, alertBeep) {
|
||||
let duplicatedList = [].concat(contacts).concat(contacts).concat(contacts)
|
||||
// let duplicatedList = [].concat(contacts).concat(contacts).concat(contacts)
|
||||
let duplicatedList = [].concat(contacts)
|
||||
await duplicatedList.reduce(async (promise, contactPojo) => {
|
||||
// This line will wait for the last async function to finish.
|
||||
// The first iteration uses an already resolved Promise
|
||||
|
||||
Reference in New Issue
Block a user