File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
oura-library/src/main/kotlin/org/radarbase/oura/request Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -132,16 +132,17 @@ constructor(
132132 request.user,
133133 Instant .ofEpochSecond(offset).plus(Duration .ofMillis(500 )),
134134 )
135- val nextRequestTime = userNextRequest[request.user.versionedId]
135+ val currentNextRequestTime = userNextRequest[request.user.versionedId]
136+ val nextRequestTime = Instant .now().plus(SUCCESS_BACK_OFF_TIME )
136137 userNextRequest[request.user.versionedId] =
137- nextRequestTime ?.let {
138- if (nextRequestTime > Instant .now() ) {
139- nextRequestTime
138+ currentNextRequestTime ?.let {
139+ if (currentNextRequestTime > nextRequestTime ) {
140+ currentNextRequestTime
140141 } else {
141- Instant .now().plus( SUCCESS_BACK_OFF_TIME )
142+ nextRequestTime
142143 }
143144 }
144- ? : Instant .now().plus( SUCCESS_BACK_OFF_TIME )
145+ ? : nextRequestTime
145146 } else {
146147 if (request.startDate.plus(TIME_AFTER_REQUEST ).isBefore(Instant .now())) {
147148 ouraOffsetManager.updateOffsets(
You can’t perform that action at this time.
0 commit comments