[FIX] Add writeLock for Client in launchserver.config.reload

This commit is contained in:
Gravita 2025-05-30 14:48:48 +07:00
parent b8f6857ef2
commit 1e4e1c5837

View file

@ -226,8 +226,15 @@ public void reload(ReloadType type) throws Exception {
if(!type.equals(ReloadType.NO_AUTH)) {
nettyServerSocketHandler.nettyServer.service.forEachActiveChannels((channel, wsHandler) -> {
Client client = wsHandler.getClient();
if(client.auth != null) {
var lock = client.writeLock();
lock.lock();
try {
if (client.auth_id == null) {
return;
}
client.auth = config.getAuthProviderPair(client.auth_id);
} finally {
lock.unlock();
}
});
}