forked from Limework/RediSkript
so I found that this threadpool was actually needed, oops
due to it not having threadpool, froze my server at one point
This commit is contained in:
@@ -49,17 +49,17 @@ public class EffSendMessage extends Effect {
|
||||
json.put("Date", System.currentTimeMillis()); //for unique string every time & PING calculations
|
||||
byte[] msg;
|
||||
RedisManager manager = plugin.getRm();
|
||||
|
||||
if (manager.getEncryption().isEncryptionEnabled()) {
|
||||
msg = manager.getEncryption().encrypt(json.toString());
|
||||
} else {
|
||||
msg = json.toString().getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
try {
|
||||
BinaryJedis j = manager.getJedisPool().getResource();
|
||||
|
||||
j.publish(channel.getBytes(StandardCharsets.UTF_8), msg);
|
||||
j.close();
|
||||
manager.getRedisService().execute(() -> {
|
||||
BinaryJedis j = manager.getJedisPool().getResource();
|
||||
j.publish(channel.getBytes(StandardCharsets.UTF_8), msg);
|
||||
j.close();
|
||||
});
|
||||
} catch (JedisConnectionException exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user