Skip to content

Commit c24c89e

Browse files
committed
UUpdate back off times
1 parent 5b32e99 commit c24c89e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

oura-library/src/main/kotlin/org/radarbase/oura/request/OuraRequestGenerator.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ constructor(
9090
offsetTime.coerceAtLeast(startDate)
9191
}
9292
val endDate = if (user.endDate >= Instant.now()) Instant.now() else user.endDate
93-
if (Duration.between(startOffset, endDate).toDays() <= ONE_DAY) {
93+
if (Duration.between(startOffset, endDate) <= ONE_DAY) {
9494
logger.info("Interval between dates is too short. Backing off..")
9595
userNextRequest[user.versionedId] = Instant.now().plus(USER_BACK_OFF_TIME)
9696
return emptySequence()
@@ -242,8 +242,8 @@ constructor(
242242
companion object {
243243
private val logger = LoggerFactory.getLogger(OuraRequestGenerator::class.java)
244244
private val BACK_OFF_TIME = Duration.ofMinutes(10L)
245-
private val ONE_DAY = 1L
246-
private val TIME_AFTER_REQUEST = Duration.ofDays(10)
245+
private val ONE_DAY = Duration.ofDays(1L)
246+
private val TIME_AFTER_REQUEST = Duration.ofDays(30)
247247
private val USER_BACK_OFF_TIME = Duration.ofHours(12L)
248248
private val SUCCESS_BACK_OFF_TIME = Duration.ofMinutes(1L)
249249
private val USER_MAX_REQUESTS = 20

0 commit comments

Comments
 (0)