No delay at all for initial timestamp
This commit is contained in:
parent
96bfb857f7
commit
dfdb7857f6
|
@ -222,9 +222,7 @@ class AutosensDataStoreObject : AutosensDataStore {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val newBucketedData = ArrayList<InMemoryGlucoseValue>()
|
val newBucketedData = ArrayList<InMemoryGlucoseValue>()
|
||||||
|
var currentTime = bgReadings[0].timestamp
|
||||||
// Round time to 1 minute, This sets timestamp a bit in the past, but not much longer that it is noticable
|
|
||||||
var currentTime = bgReadings[0].timestamp - bgReadings[0].timestamp % T.mins(1).msecs()
|
|
||||||
val adjustedTime = adjustToReferenceTime(currentTime)
|
val adjustedTime = adjustToReferenceTime(currentTime)
|
||||||
// after adjusting time may be newer. In this case use T-5min
|
// after adjusting time may be newer. In this case use T-5min
|
||||||
currentTime = if (adjustedTime > currentTime) adjustedTime - T.mins(5).msecs() else adjustedTime
|
currentTime = if (adjustedTime > currentTime) adjustedTime - T.mins(5).msecs() else adjustedTime
|
||||||
|
|
Loading…
Reference in a new issue