mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-04-21 01:56:55 -04:00
Add time unit parameter
This commit is contained in:
@@ -33,7 +33,7 @@ public class AutoUnlocker {
|
||||
this.scheduler = scheduler;
|
||||
}
|
||||
|
||||
public void tryUnlockForTimespan(int timespan) {
|
||||
public void tryUnlockForTimespan(int timespan, TimeUnit timeUnit) {
|
||||
// Unlock all available auto unlock vaults
|
||||
unlock(vaults.stream().filter(v -> v.getVaultSettings().unlockAfterStartup().get()));
|
||||
|
||||
@@ -41,7 +41,7 @@ public class AutoUnlocker {
|
||||
if (getMissingAutoUnlockVaults().findAny().isPresent()) {
|
||||
LOG.info("Found MISSING vaults, starting periodic check");
|
||||
unlockMissingFuture = scheduler.scheduleWithFixedDelay(this::unlockMissing, 0, 1, TimeUnit.SECONDS);
|
||||
timeoutFuture = scheduler.schedule(this::timeout, timespan, TimeUnit.MINUTES);
|
||||
timeoutFuture = scheduler.schedule(this::timeout, timespan, timeUnit);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javafx.application.Platform;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@FxApplicationScoped
|
||||
public class FxApplication {
|
||||
@@ -68,6 +69,6 @@ public class FxApplication {
|
||||
});
|
||||
|
||||
launchEventHandler.startHandlingLaunchEvents();
|
||||
autoUnlocker.tryUnlockForTimespan(2);
|
||||
autoUnlocker.tryUnlockForTimespan(2, TimeUnit.MINUTES);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user