forked from Limework/RediSkript
,.
This commit is contained in:
parent
68589c37a0
commit
b6a8b5005c
@ -8,6 +8,8 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="61139119-6327-48a6-9183-0df6346ed8d8" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/net/limework/skLimework/AddonPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/limework/skLimework/AddonPlugin.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/net/limework/skLimework/Events/RedisSub.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/limework/skLimework/Events/RedisSub.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
@ -77,8 +77,8 @@ public class AddonPlugin extends JavaPlugin {
|
||||
public void onDisable(){
|
||||
redisSub.shutdown();
|
||||
service.shutdown();
|
||||
try { service.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { e.printStackTrace(); }
|
||||
jedisPool.close();
|
||||
try { service.awaitTermination(3, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); }
|
||||
jedisPool.close();
|
||||
}
|
||||
|
||||
public AddonPlugin getInstance() {
|
||||
|
@ -27,7 +27,7 @@ public class RedisSub extends JedisPubSub implements Runnable{
|
||||
public void run(){
|
||||
try{
|
||||
this.j.subscribe(this, channels);
|
||||
} catch (JedisConnectionException je){
|
||||
} catch (Exception je){
|
||||
plugin.getLogger().warning("Lost connection to redis!");
|
||||
newJedis();
|
||||
}
|
||||
@ -43,7 +43,7 @@ public class RedisSub extends JedisPubSub implements Runnable{
|
||||
this.j = plugin.getJedisPool().getResource();
|
||||
plugin.getLogger().info("Connected!");
|
||||
break;
|
||||
}catch (JedisConnectionException e){
|
||||
}catch (Exception e){
|
||||
plugin.getLogger().warning("reconnecting to Redis has Failed! retrying in 4 seconds!");
|
||||
try { Thread.sleep(4000);}catch (InterruptedException ignored){}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user