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

This commit is contained in:
Jon Chambers 2020-06-11 16:43:34 -04:00 committed by Jon Chambers
parent a0bebca1e6
commit 17cfd4924c
1 changed files with 7 additions and 9 deletions

View File

@ -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);
});
});
}