From e7b87cca5487ecd63e6bd05bca40ef79ced95ef8 Mon Sep 17 00:00:00 2001 From: Joshua Collins Date: Thu, 20 Aug 2020 13:24:31 -0400 Subject: [PATCH] added buffer --- app/store/agents.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/store/agents.js b/app/store/agents.js index 59b0627..fc62813 100644 --- a/app/store/agents.js +++ b/app/store/agents.js @@ -23,7 +23,7 @@ const Agents = () => { return null } else { const lbd = moment(agent.last_beacon_date, 'MM/DD/YYYY, hh:mm:ss A').utc() - const diff = (lbd.diff(moment().utc(), 'seconds') * -1) + const diff = (lbd.diff(moment().utc(), 'seconds') * -1) + 20 if (diff > agent.interval) { agent.status = false } @@ -64,7 +64,7 @@ const Agents = () => { obj.getAllAgents = () => { obj.agents.forEach(agent => { const lbd = moment(agent.last_beacon_date, 'MM/DD/YYYY, hh:mm:ss A').utc() - const diff = (lbd.diff(moment().utc(), 'seconds') * -1) + const diff = (lbd.diff(moment().utc(), 'seconds') * -1) + 20 if (diff > agent.interval) { agent.status = false }