Fixed a poorly-mirrored write operation to the new cluster.

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2020-06-16 16:46:41 -04:00
1 parent a0bebca1e6
commit 17cfd4924c
1 file changed
+7 -9
@@ -181,18 +181,16 @@ public class UsernamesManager {
final String uuidMapKey = getUuidMapKey(uuid);
redisGet(uuid).ifPresent(username -> {
jedis.del(getUsernameMapKey(username));
final String usernameMapKey = getUsernameMapKey(username);
jedis.del(usernameMapKey);
jedis.del(uuidMapKey);
});
cacheCluster.useWriteCluster(connection -> {
final RedisAdvancedClusterAsyncCommands<String, String> asyncCommands = connection.async();
cacheCluster.useWriteCluster(connection -> {
final RedisAdvancedClusterAsyncCommands<String, String> asyncCommands = connection.async();
asyncCommands.get(uuidMapKey).thenAccept(username -> {
if (username != null) {
asyncCommands.del(getUsernameMapKey(username));
asyncCommands.del(uuidMapKey);
}
asyncCommands.del(usernameMapKey);
asyncCommands.del(uuidMapKey);
});
});
}