From e09c456a13d732d940c7783ec1d9d5d53d2b7ff2 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Thu, 3 Oct 2019 19:31:15 +0100 Subject: [PATCH] make the download retry interval in seconds, default still 1 minute --- core/src/main/groovy/com/muwire/core/MuWireSettings.groovy | 2 +- gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy | 4 ++-- gui/griffon-app/views/com/muwire/gui/OptionsView.groovy | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy b/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy index 29f46484..a4b7b8a8 100644 --- a/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy +++ b/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy @@ -46,7 +46,7 @@ class MuWireSettings { nickname = props.getProperty("nickname","MuWireUser") downloadLocation = new File((String)props.getProperty("downloadLocation", System.getProperty("user.home"))) - downloadRetryInterval = Integer.parseInt(props.getProperty("downloadRetryInterval","1")) + downloadRetryInterval = Integer.parseInt(props.getProperty("downloadRetryInterval","60")) updateCheckInterval = Integer.parseInt(props.getProperty("updateCheckInterval","24")) autoDownloadUpdate = Boolean.parseBoolean(props.getProperty("autoDownloadUpdate","true")) updateType = props.getProperty("updateType","jar") diff --git a/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy b/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy index 2f366a0a..d4ce66e0 100644 --- a/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy +++ b/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy @@ -191,7 +191,7 @@ class MainFrameModel { return int retryInterval = core.muOptions.downloadRetryInterval if (retryInterval > 0) { - retryInterval *= 60000 + retryInterval *= 1000 long now = System.currentTimeMillis() if (now - lastRetryTime > retryInterval) { lastRetryTime = now @@ -207,7 +207,7 @@ class MainFrameModel { } } - }, 60000, 60000) + }, 1000, 1000) runInsideUIAsync { trusted.addAll(core.trustService.good.values()) diff --git a/gui/griffon-app/views/com/muwire/gui/OptionsView.groovy b/gui/griffon-app/views/com/muwire/gui/OptionsView.groovy index 093c9589..8c882b63 100644 --- a/gui/griffon-app/views/com/muwire/gui/OptionsView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/OptionsView.groovy @@ -71,7 +71,7 @@ class OptionsView { gridBagLayout() label(text : "Retry failed downloads every", constraints : gbc(gridx: 0, gridy: 0)) retryField = textField(text : bind { model.downloadRetryInterval }, columns : 2, constraints : gbc(gridx: 1, gridy: 0)) - label(text : "minutes", constraints : gbc(gridx : 2, gridy: 0)) + label(text : "seconds", constraints : gbc(gridx : 2, gridy: 0)) label(text : "Check for updates every", constraints : gbc(gridx : 0, gridy: 1)) updateField = textField(text : bind {model.updateCheckInterval }, columns : 2, constraints : gbc(gridx : 1, gridy: 1))