One more increase to treatment load time to cover long overrides

This commit is contained in:
Sulka Haro
2020-09-16 09:52:42 +03:00
parent 0a79cb1e2d
commit fbe3e9b571
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -10,7 +10,9 @@
"ONE_DAY" : 86400000,
"TWO_DAYS" : 172800000,
"FIFTEEN_MINUTES": 900000,
"THIRTY_MINUTES": 1800000,
"ONE_HOUR": 3600000,
"THREE_HOURS": 10800000,
"FOUR_HOURS": 14400000,
"ONE_HOUR": 3600000
"SIX_HOURS": 21600000
}
+1 -1
View File
@@ -309,7 +309,7 @@ function loadTreatments(ddata, ctx, callback) {
// Load 2.5 days to cover last 48 hours including overlapping temp boluses or temp targets for first load
// Subsequently load at least 15 minutes of data, but if latest entry is older than 15 minutes, load until that entry
const loadPeriod = ddata.treatments && ddata.treatments.length > 0 && !withFrame ? constants.FOUR_HOURS : longLoad;
const loadPeriod = ddata.treatments && ddata.treatments.length > 0 && !withFrame ? constants.SIX_HOURS : longLoad;
const latestEntry = ddata.treatments && ddata.treatments.length > 0 ? findLatestMills(ddata.treatments) : ddata.lastUpdated;
const loadTime = Math.min(ddata.lastUpdated - loadPeriod, latestEntry);