mirror of
https://github.com/Xiao-MoMi/Custom-Fishing.git
synced 2025-12-19 15:09:24 +00:00
make redis thread blocking
This commit is contained in:
@@ -274,6 +274,7 @@ public class BukkitStorageManager implements StorageManager, Listener {
|
||||
}
|
||||
if (triedTimes >= 6) {
|
||||
waitLock(uuid, 3);
|
||||
task.cancel();
|
||||
return;
|
||||
}
|
||||
redisManager.getPlayerData(uuid, false).thenAccept(optionalData -> {
|
||||
|
||||
@@ -265,7 +265,6 @@ public class RedisManager extends AbstractStorage {
|
||||
@Override
|
||||
public CompletableFuture<Optional<PlayerData>> getPlayerData(UUID uuid, boolean lock) {
|
||||
var future = new CompletableFuture<Optional<PlayerData>>();
|
||||
plugin.getScheduler().async().execute(() -> {
|
||||
try (Jedis jedis = jedisPool.getResource()) {
|
||||
byte[] key = getRedisKey("cf_data", uuid);
|
||||
byte[] data = jedis.get(key);
|
||||
@@ -278,7 +277,6 @@ public class RedisManager extends AbstractStorage {
|
||||
} catch (Exception e) {
|
||||
future.complete(Optional.empty());
|
||||
}
|
||||
});
|
||||
return future;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user