Commit b7f37177 by Future

ehcache

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