From 48cae0d659d3138ad803a51cc5ee9384ace11a07 Mon Sep 17 00:00:00 2001 From: Lei PAN Date: Sat, 18 Feb 2023 12:12:22 +0100 Subject: [PATCH 1/2] more device --- clear_data.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clear_data.sh b/clear_data.sh index 7194a78..f903acb 100644 --- a/clear_data.sh +++ b/clear_data.sh @@ -275,4 +275,8 @@ adb -s emulator-5562 shell am start -n com.android.chrome/com.google.android.app #18 adb -s emulator-5558 shell pm clear com.android.chrome adb -s emulator-5558 shell am set-debug-app --persistent com.android.chrome -adb -s emulator-5558 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main \ No newline at end of file +adb -s emulator-5558 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main + +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 start -n com.android.chrome/com.google.android.apps.chrome.Main \ No newline at end of file From 5cae47ea4b315707b80982ad2fd43b57dd5e4c82 Mon Sep 17 00:00:00 2001 From: Lei PAN Date: Thu, 23 Feb 2023 11:19:19 +0100 Subject: [PATCH 2/2] wait 90 days for already accepted appointment --- src/appointment.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/appointment.js b/src/appointment.js index 0b902b1..dbd69d1 100644 --- a/src/appointment.js +++ b/src/appointment.js @@ -7,7 +7,7 @@ const schedule = require("node-schedule"); const mongoManager = new MongoManager(); const SEVEN_DAYS_IN_S = 3600 * 24 * 7; -const THIRTY_DAYS_IN_S = 3600 * 24 * 30; +const NINETY_DAYS_IN_S = 3600 * 24 * 30 * 3; let excelUtil = new ExcelUtil(); let collectionName = formatDate(new Date()) device_to_excludes = ["47e7e36b", "e30eb015"] @@ -33,7 +33,7 @@ async function filterAlreadyAccepteddContacts(contactList) { console.log("=====handle already accepted item before booking===="); console.log("accepted_at is " + acceptedItem.accepted_at); console.log("accepted email is " + acceptedItem.email); - needToBook = acceptedItem.accepted_at + THIRTY_DAYS_IN_S <= (new Date()) / 1000; + needToBook = acceptedItem.accepted_at + NINETY_DAYS_IN_S <= (new Date()) / 1000; if (!needToBook) { console.log("already accepted appointment --> skip"); } @@ -100,7 +100,7 @@ async function needToBook(contact, mongoManager) { console.log("=====handle already accepted item===="); console.log("accepted_at is " + acceptedItem.accepted_at); console.log("accepted email is " + acceptedItem.email); - needToBook = acceptedItem.accepted_at + THIRTY_DAYS_IN_S <= (new Date()) / 1000; + needToBook = acceptedItem.accepted_at + NINETY_DAYS_IN_S <= (new Date()) / 1000; if (!needToBook) { console.log("already accepted appointment --> skip"); }