Skip to content

Commit 4044640

Browse files
committed
docs: add comment explaining offset progress in case of empty responses
1 parent c1b8147 commit 4044640

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ public void requestEmpty(RestRequest request) {
164164
lastPollPerUser.put(((FitbitRestRequest) request).getUser().getId(), lastPoll);
165165
FitbitRestRequest fitbitRequest = (FitbitRestRequest) request;
166166
Instant endOffset = fitbitRequest.getDateRange().end().toInstant();
167+
// When having polled a date range for a route for HISTORICAL_TIME_DAYS days and
168+
// the response has no data, consider this data not to be present by considering
169+
// the end of the date range as the last successful data retrieval.
167170
if (DAYS.between(endOffset, lastPoll) >= HISTORICAL_TIME_DAYS) {
168171
String key = fitbitRequest.getUser().getVersionedId();
169172
offsets.put(key, endOffset);

0 commit comments

Comments
 (0)