Merge branch 'master' of bitbucket.org:panleicim/appointment_tool_js

This commit is contained in:
2023-02-18 13:12:13 +01:00
3 changed files with 19 additions and 6 deletions
+12 -1
View File
@@ -279,4 +279,15 @@ adb -s emulator-5558 shell am start -n com.android.chrome/com.google.android.app
adb -s emulator-5560 shell pm clear com.android.chrome adb -s emulator-5560 shell pm clear com.android.chrome
adb -s emulator-5560 shell am set-debug-app --persistent com.android.chrome adb -s emulator-5560 shell am set-debug-app --persistent com.android.chrome
adb -s emulator-5560 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main adb -s emulator-5560 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
#18
adb -s 192.168.0.37:5555 shell pm clear com.android.chrome
adb -s 192.168.0.37:5555 shell am set-debug-app --persistent com.android.chrome
adb -s 192.168.0.37:5555 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
#18
adb -s 192.168.0.27:5555 shell pm clear com.android.chrome
adb -s 192.168.0.27:5555 shell am set-debug-app --persistent com.android.chrome
adb -s 192.168.0.27:5555 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
+6 -4
View File
@@ -10,6 +10,7 @@ const SEVEN_DAYS_IN_S = 3600 * 24 * 7;
const THIRTY_DAYS_IN_S = 3600 * 24 * 30; const THIRTY_DAYS_IN_S = 3600 * 24 * 30;
let excelUtil = new ExcelUtil(); let excelUtil = new ExcelUtil();
let collectionName = formatDate(new Date()) let collectionName = formatDate(new Date())
device_to_excludes = ["47e7e36b", "e30eb015"]
async function filterAlreadyBookedContacts(contactList) { async function filterAlreadyBookedContacts(contactList) {
let alreadyBookedContacts = await mongoManager.getAllSuccessfulItemsForDay(collectionName); let alreadyBookedContacts = await mongoManager.getAllSuccessfulItemsForDay(collectionName);
@@ -166,11 +167,12 @@ async function startBookWithNumbers(startNumber, endNumber, selectedStore, pathT
alert("未找到连接的设备"); alert("未找到连接的设备");
return return
} }
let segmentNumber = listWithoutBlackContact.length / devices.length; let filteredDeviceList = devices.filter(device => !device_to_excludes.includes(device.serial()))
console.log("connected device number:" + devices.length) let segmentNumber = listWithoutBlackContact.length / filteredDeviceList.length;
console.log("connected device number:" + filteredDeviceList.length)
console.log("segmentNumber:" + segmentNumber) console.log("segmentNumber:" + segmentNumber)
for (let i = 0; i < devices.length; i++) { for (let i = 0; i < filteredDeviceList.length; i++) {
startWithList(listWithoutBlackContact.slice(i * segmentNumber, segmentNumber * (i + 1)), devices[i], selectedStore, audioAnalyse, alertBeep); startWithList(listWithoutBlackContact.slice(i * segmentNumber, segmentNumber * (i + 1)), filteredDeviceList[i], selectedStore, audioAnalyse, alertBeep);
} }
}) })
}) })
+1 -1
View File
@@ -95,7 +95,7 @@ class CommandorPage {
}) })
try { try {
const item = searchTexts[Math.floor(Math.random() * searchTexts.length)]; const item = searchTexts[Math.floor(Math.random() * searchTexts.length)];
await this.page.goto("https://www.google.com/search?q=" + item, {timeout: 90 * 1000}); await this.page.goto("https://www.google.com/search?q=" + item+"&lr=lang_en", {timeout: 90 * 1000});
// await this.page.goto(RDV_URL, {timeout: 90 * 1000}); // await this.page.goto(RDV_URL, {timeout: 90 * 1000});
} catch (e) { } catch (e) {
log(e) log(e)