From bfdb5ae59549309174244fe90e1950e8a4d76c5d Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Tue, 11 Oct 2022 10:26:37 -0600 Subject: [PATCH] Cleanup comments --- functions/src/market-close-notifications.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions/src/market-close-notifications.ts b/functions/src/market-close-notifications.ts index 4e25b493..4647a837 100644 --- a/functions/src/market-close-notifications.ts +++ b/functions/src/market-close-notifications.ts @@ -65,12 +65,14 @@ export async function sendMarketCloseEmails() { ) } } + +// The downside of this approach is if this function goes down for the entire +// day of a multiple of the time period after the market has closed, it won't +// keep sending them notifications bc when it comes back online the time period will have passed function shouldSendFirstOrFollowUpCloseNotification(contract: Contract) { if (!contract.closeEmailsSent || contract.closeEmailsSent === 0) return true const { closedMultipleOfNDaysAgo, fullTimePeriodsSinceClose } = marketClosedMultipleOfNDaysAgo(contract) - // Sends another notification if it's been a multiple of N days since the market closed AND - // the number of close notifications we've sent is equal to the number of time periods since the market closed return ( contract.closeEmailsSent > 0 && closedMultipleOfNDaysAgo &&