aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/repo/RepoManager.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-11-18 15:59:40 +0100
committerLinnea Gräf <nea@nea.moe>2024-11-18 17:31:39 +0100
commit68948baff37e139a2a3f88ce3b233effb55955c4 (patch)
treea7dd3128491475ede150d269df128dd7ee19a431 /src/main/kotlin/repo/RepoManager.kt
parentfba91100cb57b4359f235bfcca352c052ec0eefb (diff)
downloadFirmament-68948baff37e139a2a3f88ce3b233effb55955c4.tar.gz
Firmament-68948baff37e139a2a3f88ce3b233effb55955c4.tar.bz2
Firmament-68948baff37e139a2a3f88ce3b233effb55955c4.zip
feat: Add repo debug information
Diffstat (limited to 'src/main/kotlin/repo/RepoManager.kt')
-rw-r--r--src/main/kotlin/repo/RepoManager.kt11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/kotlin/repo/RepoManager.kt b/src/main/kotlin/repo/RepoManager.kt
index dc39511..667ab73 100644
--- a/src/main/kotlin/repo/RepoManager.kt
+++ b/src/main/kotlin/repo/RepoManager.kt
@@ -118,12 +118,20 @@ object RepoManager {
}
fun reload() {
+ if (!TestUtil.isInTest && !MC.instance.isOnThread) {
+ MC.instance.send {
+ reload()
+ }
+ return
+ }
try {
ItemCache.ReloadProgressHud.reportProgress("Reloading from Disk",
0,
-1) // TODO: replace with a proper bouncy bar
ItemCache.ReloadProgressHud.isEnabled = true
+ logger.info("Repo reload started.")
neuRepo.reload()
+ logger.info("Repo reload completed.")
} catch (exc: NEURepositoryException) {
ErrorUtil.softError("Failed to reload repository", exc)
MC.sendChat(
@@ -171,4 +179,7 @@ object RepoManager {
return PetData(Rarity.entries[intIndex], petId, 0.0, true)
}
+ fun getRepoRef(): String {
+ return "${Config.username}/${Config.reponame}#${Config.branch}"
+ }
}