Authored by jack

redis 增加重连 解决告警问题

@@ -62,17 +62,17 @@ public class RedisTask extends Task { @@ -62,17 +62,17 @@ public class RedisTask extends Task {
62 62
63 connect(); 63 connect();
64 64
65 - //等待两秒重连  
66 - try { 65 + if (null == client || !client.isConnected()) {
  66 + //等待两秒重连
  67 + try {
67 68
68 - Thread.sleep(200); 69 + Thread.sleep(200);
69 70
70 - } catch (InterruptedException e) { 71 + } catch (InterruptedException e) {
71 72
72 - DEBUG.error("Failed to wait for reconnect to redis {}", super.url);  
73 - } 73 + DEBUG.error("Failed to wait for reconnect to redis {}", super.url);
  74 + }
74 75
75 - if (null == client || !client.isConnected()) {  
76 connect(); 76 connect();
77 } 77 }
78 78