Commit b7f37177 by Future

ehcache

parent 3042d77a
...@@ -27,16 +27,18 @@ public class EhcacheService { ...@@ -27,16 +27,18 @@ public class EhcacheService {
* @return * @return
*/ */
public Boolean getIsPush(String key) { public Boolean getIsPush(String key) {
Cache cache = cacheManager.getCache("push"); try {
String value = cache.get(key, String.class); Cache cache = cacheManager.getCache("push");
log.info("ehcache value {}", value); String value = cache.get(key, String.class);
if (StringUtils.isNotBlank(value)) { if (StringUtils.isNotBlank(value)) {
log.info("not blank {}", value); return false;
} else {
cache.put(key, "1");
return true;
}
} catch (Exception e) {
log.info("取本地push缓存异常", e);
return false; return false;
} else {
log.info("blank");
cache.put(key, "1");
return true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment