From 5cae47ea4b315707b80982ad2fd43b57dd5e4c82 Mon Sep 17 00:00:00 2001 From: Lei PAN Date: Thu, 23 Feb 2023 11:19:19 +0100 Subject: [PATCH] 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"); }