diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/profiles/LocalProfilesProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/profiles/LocalProfilesProvider.java index 6883818f..cd5faec3 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/profiles/LocalProfilesProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/profiles/LocalProfilesProvider.java @@ -23,6 +23,7 @@ import java.nio.file.*; import java.nio.file.attribute.BasicFileAttributes; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Stream; public class LocalProfilesProvider extends ProfilesProvider implements Reconfigurable { @@ -196,7 +197,7 @@ private void readCache(Path file) throws IOException { public void readProfilesDir() throws IOException { Path profilesDirPath = Path.of(profilesDir); - Map newProfiles = new HashMap<>(); + Map newProfiles = new ConcurrentHashMap<>(); IOHelper.walk(profilesDirPath, new ProfilesFileVisitor(newProfiles), false); profilesMap = newProfiles; } @@ -218,7 +219,7 @@ public void readUpdatesDir() throws IOException { public void sync(Collection dirs) throws IOException { logger.info("Syncing updates dir"); - Map newUpdatesDirMap = new HashMap<>(16); + Map newUpdatesDirMap = new ConcurrentHashMap<>(16); try (DirectoryStream dirStream = Files.newDirectoryStream(Path.of(updatesDir))) { for (final Path updateDir : dirStream) { if (Files.isHidden(updateDir))