|
|
@@ -1,5 +1,6 @@ |
|
|
|
package cc.smtweb.framework.core.cache; |
|
|
|
|
|
|
|
import cc.smtweb.framework.core.CoreAutoConfiguration; |
|
|
|
import cc.smtweb.framework.core.annotation.SwCache; |
|
|
|
import cc.smtweb.framework.core.cache.redis.RedisBroadcastEvent; |
|
|
|
import cc.smtweb.framework.core.cache.redis.RedisManager; |
|
|
@@ -27,7 +28,6 @@ import java.util.concurrent.TimeUnit; |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
public abstract class AbstractCache<T extends Serializable> implements ISwCache<String, T> { |
|
|
|
|
|
|
|
protected final static int LS_NONE = 0; |
|
|
|
protected final static int LS_LOADING = 1; |
|
|
|
protected final static int LS_LOADED = 2; |
|
|
@@ -110,7 +110,7 @@ public abstract class AbstractCache<T extends Serializable> implements ISwCache< |
|
|
|
* 否则,非lazy,从数据库加载,并更新redis |
|
|
|
*/ |
|
|
|
protected void init() { |
|
|
|
if (RedisManager.getInstance().exists(getIdent())) { |
|
|
|
if (!SwConsts.SYS_DEBUG && RedisManager.getInstance().exists(getIdent())) { |
|
|
|
log.info("从redis同步缓存!(" + getTitle() + ")"); |
|
|
|
//从缓存服务器下载到本地 |
|
|
|
syncCache(); |
|
|
|