1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-25 07:57:12 -07:00

Force update if autoUpdate is true.

This commit is contained in:
Cedric Beust 2017-03-30 12:03:48 -07:00
parent 7440048cfc
commit af5eb04e4b

View file

@ -35,7 +35,9 @@ class UpdateKobalt @Inject constructor(val github: GithubApi2, val wrapperProper
* Accepts Future<String> as `latestVersionFuture` to allow getting `latestVersion` in the background.
*/
fun checkForNewVersion(latestVersionFuture: Future<String>) {
if (Kobalt.versionCheckTimeout > Duration.between(VersionCheckTimestampFile.timestamp, Instant.now())) {
// Only check once a day, except if autoUpdate is true
if (Kobalt.versionCheckTimeout > Duration.between(VersionCheckTimestampFile.timestamp, Instant.now())
&& ! settings.autoUpdate) {
return // waits `Kobalt.versionCheckTimeout` before the next check
}