fix: Detection of the `READY`-state for `InfoChannel` was flawed
authorKai Moritz <kai@juplo.de>
Tue, 5 Mar 2024 16:50:47 +0000 (17:50 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 22 Mar 2024 16:39:20 +0000 (17:39 +0100)
src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/InfoChannel.java

index 7665fae..95f7fb0 100644 (file)
@@ -225,9 +225,10 @@ public class InfoChannel implements Channel
     {
       boolean loadInProgress = IntStream
           .range(0, numShards)
-          .anyMatch(shard -> this.nextOffset[shard] < currentOffset[partition]);
+          .anyMatch(shard -> this.nextOffset[shard] < currentOffset[shard]);
       if (!loadInProgress)
       {
+        log.info("Loading of info completed! Resuming normal operations...");
         channelState = ChannelState.READY;
       }
     }