Skip to content

Commit cdc9684

Browse files
committed
modify artificial gap to 1 minute for overlapping overrides, add comments
1 parent 0c0d471 commit cdc9684

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

LoopFollow/Controllers/Nightscout/Treatments/Overrides.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ extension MainViewController {
4545
let nextStart = NightscoutUtils.parseDate(nextDateStr)?
4646
.timeIntervalSince1970
4747
{
48-
end = min(end, nextStart - 300)
48+
end = min(end, nextStart - 60) // avoid overlapping overrides
4949
}
5050

5151
end = min(end, maxEndDate)
5252

53-
if end - start < 300 { continue }
53+
if end - start < 300 { continue } // skip short overrides
5454

5555
let dot = DataStructs.overrideStruct(
5656
insulNeedsScaleFactor: e["insulinNeedsScaleFactor"] as? Double ?? 1,

0 commit comments

Comments
 (0)