From fc2ad0014cd53aee215c3dd3ff3082417daedae8 Mon Sep 17 00:00:00 2001 From: JayWll Date: Fri, 17 Apr 2020 17:26:22 -0600 Subject: [PATCH] Updating five day interval following testing. --- nodeapp/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodeapp/app.js b/nodeapp/app.js index 6117b2a..40db81f 100644 --- a/nodeapp/app.js +++ b/nodeapp/app.js @@ -48,7 +48,7 @@ app.get('/newreading', (req, res) => { // If the low moisture flag is set but an alert has not yet been sent, determine if an alert is necessarry if (result.find(o => o.dataValues.key === 'low').dataValues.value !== '0' && result.find(o => o.dataValues.key === 'alert').dataValues.value === '0') { const lowtriggered = new Date().getTime() - new Date(result.find(o => o.dataValues.key === 'low').dataValues.value).getTime() - const fivedays = 2 * 24 * 60 * 60 * 1000 + const fivedays = 5 * 24 * 60 * 60 * 1000 // If the first low reading was more than 5 days ago, send an alert if (lowtriggered > fivedays) {