Moved call to #setOnFailed() to UpdateStatsService implementation

This commit is contained in:
JaniruTEC
2020-10-28 15:40:59 +01:00
parent d331c30224
commit f0e1bcb899

View File

@@ -36,7 +36,6 @@ public class VaultStats {
this.updateService = new UpdateStatsService();
updateService.setExecutor(executor);
updateService.setPeriod(Duration.seconds(1));
updateService.setOnFailed(event -> LOG.error("Error in UpdateStateService.", event.getSource().getException()));
state.addListener(this::vaultStateChanged);
}
@@ -60,6 +59,10 @@ public class VaultStats {
private class UpdateStatsService extends ScheduledService<Optional<CryptoFileSystemStats>> {
private UpdateStatsService() {
setOnFailed(event -> LOG.error("Error in UpdateStateService.", getException()));
}
@Override
protected Task<Optional<CryptoFileSystemStats>> createTask() {
return new Task<>() {