This commit is contained in:
ham1255
2020-05-18 01:57:36 +04:00
parent 8b4af2450c
commit 46978fc170
3 changed files with 6 additions and 4 deletions

View File

@@ -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() {

View File

@@ -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){}
}