Delete old username mapping when setting new one
This commit is contained in:
parent
99760ba6a0
commit
82486a873a
|
@ -112,6 +112,8 @@ public class UsernamesManager {
|
|||
try (Jedis jedis = cacheClient.getWriteResource();
|
||||
Timer.Context ignored = redisSetTimer.time())
|
||||
{
|
||||
Optional.ofNullable(jedis.get(getUuidMapKey(uuid))).ifPresent(oldUsername -> jedis.del(getUsernameMapKey(oldUsername)));
|
||||
|
||||
jedis.set(getUuidMapKey(uuid), username);
|
||||
jedis.set(getUsernameMapKey(username), uuid.toString());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue