mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 00:38:11 -07:00
Force update if autoUpdate is true.
This commit is contained in:
parent
7440048cfc
commit
af5eb04e4b
1 changed files with 3 additions and 1 deletions
|
@ -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.
|
* Accepts Future<String> as `latestVersionFuture` to allow getting `latestVersion` in the background.
|
||||||
*/
|
*/
|
||||||
fun checkForNewVersion(latestVersionFuture: Future<String>) {
|
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
|
return // waits `Kobalt.versionCheckTimeout` before the next check
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue