mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 00:31:27 +00:00
suppress logging of expected exception
This commit is contained in:
@@ -3,6 +3,8 @@ package org.cryptomator.ui.fxapp;
|
||||
import org.cryptomator.event.FSEventBucket;
|
||||
import org.cryptomator.event.FSEventBucketContent;
|
||||
import org.cryptomator.event.FileSystemEventAggregator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.application.Platform;
|
||||
@@ -11,6 +13,7 @@ import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -23,6 +26,8 @@ import java.util.concurrent.TimeUnit;
|
||||
@FxApplicationScoped
|
||||
public class FxFSEventList {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(FxFSEventList.class);
|
||||
|
||||
private final ObservableList<Map.Entry<FSEventBucket, FSEventBucketContent>> events;
|
||||
private final FileSystemEventAggregator eventAggregator;
|
||||
private final ScheduledExecutorService scheduler;
|
||||
@@ -37,7 +42,13 @@ public class FxFSEventList {
|
||||
}
|
||||
|
||||
public void schedulePollForUpdates() {
|
||||
scheduler.schedule(this::checkForEventUpdates, 1000, TimeUnit.MILLISECONDS);
|
||||
try {
|
||||
scheduler.schedule(this::checkForEventUpdates, 1000, TimeUnit.MILLISECONDS);
|
||||
} catch ( RejectedExecutionException e) {
|
||||
if(!scheduler.isShutdown()) {
|
||||
LOG.warn("Failed to poll for filesystem events", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user