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

@ -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" />

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