File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
oura-library/src/main/kotlin/org/radarbase/oura Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ constructor(
8989 logger.info(" Offsets found in persistence: " + offsetTime.toString())
9090 offsetTime.coerceAtLeast(startDate)
9191 }
92- val endDate = if ( user.endDate >= Instant .now()) Instant .now() else user.endDate
92+ val endDate = user.endDate?.coerceAtMost( Instant .now()) ? : Instant .now()
9393 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 )
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ data class OuraUser(
1616 @JsonProperty(" externalId" ) override val externalId : String? ,
1717 @JsonProperty(" isAuthorized" ) override val isAuthorized : Boolean ,
1818 @JsonProperty(" startDate" ) override val startDate : Instant ,
19- @JsonProperty(" endDate" ) override val endDate : Instant ,
19+ @JsonProperty(" endDate" ) override val endDate : Instant ? = null ,
2020 @JsonProperty(" version" ) override val version : String? = null ,
2121 @JsonProperty(" serviceUserId" ) override val serviceUserId : String? = null ,
2222) : User {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ interface User {
1010 val sourceId: String
1111 val externalId: String?
1212 val startDate: Instant
13- val endDate: Instant
13+ val endDate: Instant ?
1414 val createdAt: Instant
1515 val humanReadableUserId: String?
1616 val serviceUserId: String?
You can’t perform that action at this time.
0 commit comments