File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
src/main/kotlin/com/lambda/loader Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,18 @@ class LoaderVersionController(
8383 fun checkForUpdate (): String? {
8484 return try {
8585 val currentVersion = getCurrentLoaderVersion()
86- val latestVersion = when (getReleaseMode()) {
87- ReleaseMode .STABLE -> checkReleasesVersion()
86+
87+ // Try to get latest version based on release mode, with fallback
88+ var latestVersion = when (getReleaseMode()) {
89+ ReleaseMode .STABLE -> {
90+ val releaseVersion = checkReleasesVersion()
91+ if (releaseVersion == null ) {
92+ logger.warning(" No stable loader version found, falling back to snapshot" )
93+ checkSnapshotVersion()
94+ } else {
95+ releaseVersion
96+ }
97+ }
8898 ReleaseMode .SNAPSHOT -> checkSnapshotVersion()
8999 }
90100
@@ -102,7 +112,9 @@ class LoaderVersionController(
102112 logger.info(" Loader update available: $currentVersion -> $latestVersion " )
103113 return latestVersion
104114 } else {
105- logger.info(" Loader is up to date: $currentVersion " )
115+ if (ConfigManager .config.debug) {
116+ logger.info(" Loader is up to date: $currentVersion " )
117+ }
106118 return null
107119 }
108120 } catch (e: Exception ) {
You can’t perform that action at this time.
0 commit comments