Skip to content

Commit bf640b6

Browse files
committed
fix: historic lookback for resting heart rate data
1 parent 4eb7ead commit bf640b6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

kafka-connect-fitbit-source/src/main/java/org/radarbase/connect/rest/fitbit/route/FitbitRestingHeartRateRoute.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ protected Stream<FitbitRestRequest> createRequests(User user) {
5151
ZonedDateTime startDate = this.getOffset(user).plus(ONE_DAY)
5252
.atZone(UTC)
5353
.truncatedTo(DAYS);
54-
// Note: the date range of startDate to now() is not correct, but will ensure that in case of empty
55-
// results, the HISTORICAL_TIME_DAYS retry inactivation in requestEmpty() of FitbitPollingRoute.java
56-
// will never be used.
57-
return Stream.of(newRequest(user, new DateRange(startDate, ZonedDateTime.now(UTC)),
54+
ZonedDateTime endDate = startDate.minus(ONE_NANO);
55+
return Stream.of(newRequest(user, new DateRange(startDate, endDate),
5856
user.getExternalUserId(), DATE_FORMAT.format(startDate)));
5957
}
6058

0 commit comments

Comments
 (0)