diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ComponentCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ComponentCommand.java index 4ff72e01..576a987b 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ComponentCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ComponentCommand.java @@ -37,7 +37,6 @@ public void printHelp() { logger.info("Print help for component:"); logger.info("component unload [componentName]"); logger.info("component load [componentName] [filename]"); - logger.info("component gc [componentName]"); } @Override diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/sync/SyncCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/sync/SyncCommand.java index f645eaaa..099e6c25 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/sync/SyncCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/sync/SyncCommand.java @@ -11,11 +11,12 @@ public SyncCommand(LaunchServer server) { this.childCommands.put("updates", new SyncUpdatesCommand(server)); this.childCommands.put("up", new SyncUPCommand(server)); this.childCommands.put("launchermodules", new SyncLauncherModulesCommand(server)); + this.childCommands.put("updatescache", new SyncUpdatesCacheCommand(server)); } @Override public String getArgsDescription() { - return "[updates/profiles/up/binaries/launchermodules] [args...]"; + return "[updates/profiles/up/binaries/launchermodules/updatescache] [args...]"; } @Override diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/sync/SyncUpdatesCacheCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/sync/SyncUpdatesCacheCommand.java new file mode 100644 index 00000000..19c30fac --- /dev/null +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/sync/SyncUpdatesCacheCommand.java @@ -0,0 +1,25 @@ +package pro.gravit.launchserver.command.sync; + +import pro.gravit.launchserver.LaunchServer; +import pro.gravit.launchserver.command.Command; + +public class SyncUpdatesCacheCommand extends Command { + public SyncUpdatesCacheCommand(LaunchServer server) { + super(server); + } + + @Override + public String getArgsDescription() { + return null; + } + + @Override + public String getUsageDescription() { + return "sync updates cache"; + } + + @Override + public void invoke(String... args) throws Exception { + server.updatesManager.readUpdatesFromCache(); + } +} diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/UpdatesManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/UpdatesManager.java index 848fa27b..c2642d2e 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/UpdatesManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/UpdatesManager.java @@ -52,6 +52,10 @@ private void readCache(Path file) throws IOException { this.updatesDirMap = Collections.unmodifiableMap(updatesDirMap); } + public void readUpdatesFromCache() throws IOException { + readCache(cacheFile); + } + public void readUpdatesDir() throws IOException { if (server.config.cacheUpdates) { if (Files.exists(cacheFile)) {