Kaynağa Gözat

增加SWConsts.debug,是否调试模式,调试模式缓存从数据库加载

4.0
郑根木 2 yıl önce
ebeveyn
işleme
407397fa1e
5 değiştirilmiş dosya ile 5 ekleme ve 6 silme
  1. +0
    -2
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/spring/BpmConfigBean.java
  2. +0
    -1
      smtweb-framework/bpm/src/main/resources/config/application.yaml
  3. +1
    -1
      smtweb-framework/core/src/main/java/cc/smtweb/framework/core/CoreAutoConfiguration.java
  4. +2
    -2
      smtweb-framework/core/src/main/java/cc/smtweb/framework/core/cache/AbstractCache.java
  5. +2
    -0
      smtweb-framework/core/src/main/java/cc/smtweb/framework/core/common/SwConsts.java

+ 0
- 2
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/spring/BpmConfigBean.java Dosyayı Görüntüle

@@ -8,8 +8,6 @@ import org.springframework.stereotype.Component;
@ConfigurationProperties(prefix = "smtweb.bpm")
@Data
public class BpmConfigBean {
// 是否debug模式
private boolean debug;
private String codeJavaPath;
private int mode;
}

+ 0
- 1
smtweb-framework/bpm/src/main/resources/config/application.yaml Dosyayı Görüntüle

@@ -20,7 +20,6 @@ smtweb:
#ftp 密码
attach-ftp-pwd: Bjjt@2021
bpm:
debug: true
# 有.idea或pom.xml文件的目录
code-java-path: 'd:/work/smtweb2/smtweb-framework'
# 读取模式 1-读取pom.xml,要求module名同目录 2-读取.idea/modules.xml


+ 1
- 1
smtweb-framework/core/src/main/java/cc/smtweb/framework/core/CoreAutoConfiguration.java Dosyayı Görüntüle

@@ -20,7 +20,7 @@ public class CoreAutoConfiguration {
*/
@Value("${smtweb.machine-id}")
private int machineId;
@Bean
public IdGenerator idGenerator() {
return new IdGenerator(machineId);


+ 2
- 2
smtweb-framework/core/src/main/java/cc/smtweb/framework/core/cache/AbstractCache.java Dosyayı Görüntüle

@@ -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();


+ 2
- 0
smtweb-framework/core/src/main/java/cc/smtweb/framework/core/common/SwConsts.java Dosyayı Görüntüle

@@ -4,6 +4,8 @@ package cc.smtweb.framework.core.common;
* Created by Akmm at 2022/3/23 9:46
*/
public interface SwConsts {
//开发调试模式
boolean SYS_DEBUG = true;
int DEFAULT_ORDER = 1;
//缓存中:树节点按parent的key
String KEY_PARENT_ID = "pr";


Yükleniyor…
İptal
Kaydet