diff --git a/src/main/java/vc/live/LiveFeed.java b/src/main/java/vc/live/LiveFeed.java index 902e862..acc5ebf 100644 --- a/src/main/java/vc/live/LiveFeed.java +++ b/src/main/java/vc/live/LiveFeed.java @@ -64,7 +64,7 @@ public LiveFeed(final RedisClient redisClient, this.executorService = executorService; this.objectMapper = objectMapper; syncChannels(); - this.executorService.scheduleAtFixedRate(this::processMessageQueue, ((int) (Math.random() * 10)), 10, SECONDS); + this.executorService.scheduleWithFixedDelay(this::processMessageQueue, ((int) (Math.random() * 10)), 10, SECONDS); inputQueues().forEach(this::monitorQueue); } @@ -73,7 +73,7 @@ record InputQueue(String queueName, Class deserializedType, Function queue = this.redisClient.getQueue(inputQueue.queueName()); inputQueues.put(inputQueue, queue); - this.executorService.scheduleAtFixedRate(() -> processInputQueue(queue, inputQueue), 1, 3, SECONDS); + this.executorService.scheduleWithFixedDelay(() -> processInputQueue(queue, inputQueue), 1, 3, SECONDS); } private String feedName() {