From 0894e0b9c3e1f06aac7d7ca60fa351711801e821 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:11:12 +0700 Subject: [PATCH] [FIX] Sync profiles before updates --- .../java/pro/gravit/launchserver/LaunchServer.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java index 1e283ffd..d3adfbae 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java @@ -355,14 +355,17 @@ public void run() { // Sync updates dir CommonHelper.newThread("Profiles and updates sync", true, () -> { try { - if (!IOHelper.isDir(updatesDir)) - Files.createDirectory(updatesDir); - updatesManager.readUpdatesDir(); - // Sync profiles dir if (!IOHelper.isDir(profilesDir)) Files.createDirectory(profilesDir); syncProfilesDir(); + + // Sync updates dir + if (!IOHelper.isDir(updatesDir)) + Files.createDirectory(updatesDir); + updatesManager.readUpdatesDir(); + + modulesManager.invokeEvent(new LaunchServerProfilesSyncEvent(this)); } catch (IOException e) { logger.error("Updates/Profiles not synced", e);