瀏覽代碼

fixed exception when scheduling the next regular update check while auto check is disabled
[ci skip]

Sebastian Stenzel 5 年之前
父節點
當前提交
d51debf736
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      main/ui/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java

+ 2 - 1
main/ui/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java

@@ -24,6 +24,7 @@ public abstract class UpdateCheckerModule {
 
 	private static final URI LATEST_VERSION_URI = URI.create("https://api.cryptomator.org/updates/latestVersion.json");
 	private static final Duration UPDATE_CHECK_INTERVAL = Duration.hours(3);
+	private static final Duration DISABLED_UPDATE_CHECK_INTERVAL = Duration.hours(100000); // Duration.INDEFINITE leads to overflows...
 
 	@Provides
 	@Named("latestVersion")
@@ -56,7 +57,7 @@ public abstract class UpdateCheckerModule {
 	@Named("checkForUpdatesInterval")
 	@FxApplicationScoped
 	static ObjectBinding<Duration> provideCheckForUpdateInterval(Settings settings) {
-		return Bindings.when(settings.checkForUpdates()).then(UPDATE_CHECK_INTERVAL).otherwise(Duration.INDEFINITE);
+		return Bindings.when(settings.checkForUpdates()).then(UPDATE_CHECK_INTERVAL).otherwise(DISABLED_UPDATE_CHECK_INTERVAL);
 	}
 
 	@Provides