File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,11 @@ class FixRestChannel {
6969 final Instant startAt , final boolean reverse ) {
7070
7171 final ToLongFunction<List<T> > updateLast = { list ->
72- list. isEmpty() ? startAt : keyExtractor. applyAsInstant(list. get(list. size() - 1 )). getEpochSecond()
72+ list. isEmpty() ? startAt. getEpochSecond() : keyExtractor. applyAsInstant(list. get(list. size() - 1 )). getEpochSecond()
7373 }
7474
7575 final ToIntFunction<List<T> > updateLast_ns = { list ->
76- list. isEmpty() ? startAt : keyExtractor. applyAsInstant(list. get(list. size() - 1 )). getNano()
76+ list. isEmpty() ? startAt. getNano() : keyExtractor. applyAsInstant(list. get(list. size() - 1 )). getNano()
7777 }
7878
7979 final Comparator<T> comparator = comparingInstant(keyExtractor);
@@ -91,7 +91,8 @@ class FixRestChannel {
9191 private static Flux<ListThreadsData > listThreads (Function<Map<String , Object > , Mono<ListThreadsData > > doRequest ) {
9292 ToInstantFunction<ListThreadsData > getLastThreadId = { response ->
9393 List<ChannelData > threads = response. threads();
94- return threads. isEmpty() ? Instant . ofEpochSecond(0 ) : Instant . parse(threads. get(threads. size() - 1 ). threadMetadata(). get(). archiveTimestamp(). replace(' +00:00' , " Z" ));
94+
95+ return (! response. hasMore() || threads. isEmpty()) ? Instant . ofEpochSecond(0 ) : Instant . parse(threads. get(threads. size() - 1 ). threadMetadata(). get(). archiveTimestamp(). replace(' +00:00' , " Z" ));
9596 }
9697 final InstantFunction<Flux<ListThreadsData > > nextPage = { long s , long n ->
9798 final Map<String , Object > parameters = new HashMap<> (2 );
You can’t perform that action at this time.
0 commit comments