Skip to content

Commit

Permalink
fix shupdaterepo
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMWolfs committed Feb 3, 2024
1 parent 17a3773 commit 349ddf2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RepoManager(private val configLocation: File) {
private var latestRepoCommit: String? = null
private val repoLocation: File = File(configLocation, "repo")
private var error = false
private var lastUpdate = SimpleTimeMark.farPast()
private var lastRepoUpdate = SimpleTimeMark.farPast()

companion object {
val successfulConstants = mutableListOf<String>()
Expand Down Expand Up @@ -85,16 +85,15 @@ class RepoManager(private val configLocation: File) {
val file = File(configLocation, "repo")
if (file.exists() && currentCommitJSON != null && currentCommitJSON["sha"].asString == latestRepoCommit
) {
if (unsuccessfulConstants.isEmpty() || (command && lastUpdate.passedSince() < 1.minutes)) {

if (unsuccessfulConstants.isEmpty() && lastRepoUpdate.passedSince() < 1.minutes) {
if (command) {
LorenzUtils.chat("§7The repo is already up to date!")
atomicShouldManuallyReload.set(false)
}
return@supplyAsync false
}
}
lastUpdate = SimpleTimeMark.now()
lastRepoUpdate = SimpleTimeMark.now()
RepoUtils.recursiveDelete(repoLocation)
repoLocation.mkdirs()
val itemsZip = File(repoLocation, "sh-repo-main.zip")
Expand Down

0 comments on commit 349ddf2

Please sign in to comment.