Log exceptions when persisting messages.

This commit is contained in:
Jon Chambers
2020-09-29 13:42:55 -04:00
committed by Jon Chambers
parent e873d55cd3
commit 3e02c574e7

View File

@@ -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