模型字段取值bugfix

This commit is contained in:
2025-02-12 15:07:47 +08:00
parent 49644c99a9
commit 217b499c26
4 changed files with 75 additions and 7 deletions

View File

@@ -38,10 +38,15 @@ public class ModelDTO {
this.errorMsg = errorMsg;
}
public Evaluator getEvaluator() {
public Evaluator fetchEvaluator() {
return evaluator;
}
public String getEvaluatorInfo() {
return evaluator+"";
}
public String getText() {
return text;
}

View File

@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
@@ -45,6 +46,8 @@ public class LocalCacheService {
private final Map<String, String> infoMap = new ConcurrentHashMap<>();
private volatile boolean stop = false;
//
@Resource
@@ -66,8 +69,8 @@ public class LocalCacheService {
logger.info("LocalCacheService_init_start");
// 这里先不抛异常,后面会定时刷新缓存
updateAllCache(false);
//
CommUtil.doSleep(UPDATE_SLEEP_TIME_MS);
// CommUtil.doSleep(UPDATE_SLEEP_TIME_MS);
Thread t = new Thread();
t.start();
@@ -76,6 +79,11 @@ public class LocalCacheService {
}
@PreDestroy
public void preDestroy(){
stop = true;
}
public Map<String,Object> getInfo(){
Map<String,Object> info = new HashMap<>();
info.put("runCount",runCount.longValue());
@@ -173,8 +181,15 @@ public class LocalCacheService {
private class LocalCacheUpdateThread extends Thread{
public void run(){
runCount.getAndIncrement();
updateAllCache(false);
while(true) {
if(stop){
logger.info("LocalCacheUpdateThread_exit_for_stop");
break;
}
CommUtil.doSleep(UPDATE_SLEEP_TIME_MS);
runCount.getAndIncrement();
updateAllCache(false);
}
}
}