From 04e1dbbee782e16d278b7dcbe3c75b8580247c82 Mon Sep 17 00:00:00 2001 From: Lei PAN Date: Fri, 20 Oct 2023 09:28:08 +0200 Subject: [PATCH] set default to six --- src/appointment.js | 7 +++++-- src/workers/CommandorPage.js | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/appointment.js b/src/appointment.js index 96f662d..b8a0db2 100644 --- a/src/appointment.js +++ b/src/appointment.js @@ -12,11 +12,12 @@ const SEVEN_DAYS_IN_S = 3600 * 24 * 7; const NINETY_DAYS_IN_S = 30 * 3; let excelUtil = new ExcelUtil(); let collectionName = formatDate(new Date()) -let excludeMode = DeviceExcludeMode.SEVEN +let excludeMode = DeviceExcludeMode.SIX let three_to_excludes = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "EPHUT20825001518"] let four_to_excludes = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "e30eb015", "EPHUT20825001518"] let seven_to_excludes = ["4e8ca027", "hi7ljr5xduyt9pfi", "e30eb015", "EPHUT20825001518", "bec11752", "fy65eqs4wkvcpf9h", "fuljaueqguugf6pn", "EPHUT20825001518"] -let nine_to_excludes = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "e30eb015", "47e7e36b", "p7d6nbw8cu7duous", "njzxojhim7gedyvw", "fmiz5pa6rsx4u4ts", "fy65eqs4wkvcpf9h", "fuljaueqguugf6pn", "EPHUT20825001518"] +let six_to_excludes = ["4e8ca027", "hi7ljr5xduyt9pfi", "e30eb015", "EPHUT20825001518", "bec11752", "fy65eqs4wkvcpf9h"] +let nine_to_excludes = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "e30eb015", "47e7e36b", "p7d6nbw8cu7duous", "njzxojhim7gedyvw", "fmiz5pa6rsx4u4ts", "fy65eqs4wkvcpf9h", "fuljaueqguugf6pn", "EPHUT20825001518", "W8GMFELRHIKZS84T"] let for_scrpay = ["07fbd156", "47e7e36b", "4f55c3d4", "5ac879a2", "69db59f0", "71a0371d", "774687ff", "7b71fb20", "8f76f9e7", "99cyfiaebqcy6poj", "EPHUT20825001518", "J4AXB761H2322WJ", "W8GMFELRHIKZS84T", "ai9xv8hy599hvkee", "b41c1b72", "bec11752", "becb6e99", "c3ba032e", "d54e946", "e30eb015", "fmiz5pa6rsx4u4ts", "fuljaueqguugf6pn", "fy65eqs4wkvcpf9h", "hi7ljr5xduyt9pfi", "njzxojhim7gedyvw", "p7d6nbw8cu7duous"] attributedPorts = [] const device_port_info = new Map(); @@ -224,6 +225,8 @@ async function startBookWithNumbers(startNumber, endNumber, selectedStore, pathT device_to_excludes = nine_to_excludes; } else if (excludeMode === DeviceExcludeMode.SEVEN) { device_to_excludes = seven_to_excludes + } else if (excludeMode === DeviceExcludeMode.SIX) { + device_to_excludes = six_to_excludes } filteredDeviceList = devices.filter(device => !device_to_excludes.includes(device.serial())) let segmentNumber = listWithoutBlackContact.length / filteredDeviceList.length; diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index ca7ba74..c89a7e8 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -539,7 +539,12 @@ class CommandorPage { this.isFillingFields = false; } else { await delay(getRandomWaitTime()) - await this.clickValid(); + try { + await this.clickValid(); + } catch (e) { + this.isTerminated = true; + console.log(e) + } this.isFillingFields = false } }