diff --git a/pom.xml b/pom.xml
index ac944df..1bbb1e5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- net.limework.core
+ net.limework.rediskript
RediSkript
1.2.2
jar
diff --git a/src/main/java/net/limework/rediskript/managers/RedisManager.java b/src/main/java/net/limework/rediskript/managers/RedisManager.java
index c3d3103..090f030 100644
--- a/src/main/java/net/limework/rediskript/managers/RedisManager.java
+++ b/src/main/java/net/limework/rediskript/managers/RedisManager.java
@@ -52,7 +52,7 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable {
config.getInt("Redis.TimeOut"),
config.getString("Redis.Password"),
config.getBoolean("Redis.useTLS"));
- RedisService = Executors.newSingleThreadExecutor();
+ RedisService = Executors.newFixedThreadPool(3);
try {
this.subscribeJedis = this.jedisPool.getResource();
} catch (Exception ignored) {
@@ -163,4 +163,6 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable {
public Encryption getEncryption() {
return encryption;
}
+
+ public ExecutorService getRedisService() { return RedisService; }
}
diff --git a/src/main/java/net/limework/rediskript/skript/elements/EffSendMessage.java b/src/main/java/net/limework/rediskript/skript/elements/EffSendMessage.java
index 42a6eaf..427d704 100644
--- a/src/main/java/net/limework/rediskript/skript/elements/EffSendMessage.java
+++ b/src/main/java/net/limework/rediskript/skript/elements/EffSendMessage.java
@@ -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();
}
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 7917538..b8160e3 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,4 +1,4 @@
-main: net.limework.core.RediSkript
+main: net.limework.rediskript.RediSkript
name: RediSkript
version: ${project.version}
authors: [Govindas, ham1255, DaemonicKing]