File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
oura-library/src/main/kotlin/org/radarbase/oura/request Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ constructor(
111111 request.user,
112112 Instant .ofEpochSecond(offset).plus(Duration .ofMillis(500 )),
113113 )
114+ userNextRequest[request.user.versionedId] = Instant .now().plus(SUCCESS_BACK_OFF_TIME )
114115 } else {
115116 if (request.startDate.plus(TIME_AFTER_REQUEST ).isBefore(Instant .now())) {
116117 ouraOffsetManager.updateOffsets(
@@ -196,6 +197,7 @@ constructor(
196197 private val ONE_DAY = 1L
197198 private val TIME_AFTER_REQUEST = Duration .ofDays(30 )
198199 private val USER_BACK_OFF_TIME = Duration .ofMinutes(2L )
200+ private val SUCCESS_BACK_OFF_TIME = Duration .ofSeconds(3L )
199201 private val USER_MAX_REQUESTS = 20
200202 val JSON_FACTORY = JsonFactory ()
201203 val JSON_READER = ObjectMapper (JSON_FACTORY ).registerModule(JavaTimeModule ()).reader()
You can’t perform that action at this time.
0 commit comments