Log exceptions when persisting messages.

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2020-09-30 10:39:56 -04:00
1 parent e873d55cd3
commit 3e02c574e7
1 file changed
+7 -1
@@ -65,7 +65,13 @@ public class MessagePersister implements Managed {
persistQueuesFuture.cancel(false);
}
persistQueuesFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> this.persistNextQueues(Instant.now()), 0, 100, TimeUnit.MILLISECONDS);
persistQueuesFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> {
try {
persistNextQueues(Instant.now());
} catch (final Exception e) {
logger.warn("Failed to persist queues", e);
}
}, 0, 100, TimeUnit.MILLISECONDS);
}
@Override