@@ -26,6 +26,17 @@ public class PageCursorFactory {
2626 private PageCursor nextCursor = null ;
2727 private PageCursor prevCursor = null ;
2828
29+ /**
30+ * The search-window start and end is [inclusive, exclusive], so to calculate the start of the
31+ * search-window from the last time included in the search window we need to include one extra
32+ * minute at the end.
33+ * <p>
34+ * The value is set to 60 seconds because raptor operates in one minute increments.
35+ */
36+ private static final Duration SEARCH_WINDOW_END_EXCLUSIVITY_TIME_ADDITION = Duration .ofSeconds (
37+ 60
38+ );
39+
2940 public PageCursorFactory (SortOrder sortOrder , Duration newSearchWindow ) {
3041 this .sortOrder = sortOrder ;
3142 this .newSearchWindow = newSearchWindow ;
@@ -140,7 +151,7 @@ private void createPageCursors() {
140151 prevEdt = pageCursorInput
141152 .latestRemovedDeparture ()
142153 .minus (newSearchWindow )
143- .plus (PageCursorConstants . SEARCH_WINDOW_END_EXCLUSIVITY_TIME_ADDITION );
154+ .plus (SEARCH_WINDOW_END_EXCLUSIVITY_TIME_ADDITION );
144155 nextEdt = edtAfterUsedSw ();
145156 }
146157 }
@@ -174,7 +185,7 @@ private Instant edtAfterUsedSw() {
174185 Instant defaultEdt = currentEdt .plus (currentSearchWindow );
175186 if (firstSearchLatestItineraryDeparture != null ) {
176187 Instant edtFromLatestItineraryDeparture = firstSearchLatestItineraryDeparture .plus (
177- PageCursorConstants . SEARCH_WINDOW_END_EXCLUSIVITY_TIME_ADDITION
188+ SEARCH_WINDOW_END_EXCLUSIVITY_TIME_ADDITION
178189 );
179190 if (edtFromLatestItineraryDeparture .isBefore (defaultEdt )) {
180191 return edtFromLatestItineraryDeparture ;
0 commit comments