Commit b7f37177 by Future

ehcache

parent 3042d77a
...@@ -27,17 +27,19 @@ public class EhcacheService { ...@@ -27,17 +27,19 @@ public class EhcacheService {
* @return * @return
*/ */
public Boolean getIsPush(String key) { public Boolean getIsPush(String key) {
try {
Cache cache = cacheManager.getCache("push"); Cache cache = cacheManager.getCache("push");
String value = cache.get(key, String.class); String value = cache.get(key, String.class);
log.info("ehcache value {}", value);
if (StringUtils.isNotBlank(value)) { if (StringUtils.isNotBlank(value)) {
log.info("not blank {}", value);
return false; return false;
} else { } else {
log.info("blank");
cache.put(key, "1"); cache.put(key, "1");
return true; return true;
} }
} catch (Exception e) {
log.info("取本地push缓存异常", e);
return false;
}
} }
......
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