Showing
1 changed file
with
3 additions
and
1 deletions
@@ -82,7 +82,7 @@ public class MemcachedMonitorImpl { | @@ -82,7 +82,7 @@ public class MemcachedMonitorImpl { | ||
82 | * @param monitorUrl 监控url | 82 | * @param monitorUrl 监控url |
83 | */ | 83 | */ |
84 | private void doMonitor(StringBuffer monitorUrl) { | 84 | private void doMonitor(StringBuffer monitorUrl) { |
85 | - Map<InetSocketAddress, Map<String, String>> result = new HashMap<>(); | 85 | + Map<InetSocketAddress, Map<String, String>> result = new HashMap<>(); |
86 | try { | 86 | try { |
87 | MemcachedClient client = new XMemcachedClient(AddrUtil.getAddresses(monitorUrl.toString().trim())); | 87 | MemcachedClient client = new XMemcachedClient(AddrUtil.getAddresses(monitorUrl.toString().trim())); |
88 | result = client.getStats(); | 88 | result = client.getStats(); |
@@ -177,6 +177,8 @@ public class MemcachedMonitorImpl { | @@ -177,6 +177,8 @@ public class MemcachedMonitorImpl { | ||
177 | StringBuffer failUrl = new StringBuffer(); | 177 | StringBuffer failUrl = new StringBuffer(); |
178 | for (InetSocketAddress address: monitorUrlSet) { | 178 | for (InetSocketAddress address: monitorUrlSet) { |
179 | failUrl.append(address.toString()+" "); | 179 | failUrl.append(address.toString()+" "); |
180 | + //获取失败时从缓存中移除数据 | ||
181 | + MemConstants.MEMCACHED_INFO_MAP.remove(address.toString().substring(1,address.toString().length())); | ||
180 | } | 182 | } |
181 | alarmMsgService.sendSms("Memcached", "Failed to get Memcached status" + failUrl.toString() + " .", snsMobileConfig.getBaseMobile()); | 183 | alarmMsgService.sendSms("Memcached", "Failed to get Memcached status" + failUrl.toString() + " .", snsMobileConfig.getBaseMobile()); |
182 | 184 |
-
Please register or login to post a comment