缩略图速度

parent 074de057
......@@ -63,6 +63,14 @@ public class SceneService {
return new File(resultDir, fileName);
}
public File getCurrentChromosomeFile(String sceneId) {
SceneChromsome sceneChromsome = (SceneChromsome) redisUtils.get("SceneId." + sceneId);
if (sceneChromsome == null) {
return getChromosomeFile(sceneId);
}
return getChromosomeFile(sceneId, sceneChromsome.getVersion().toString());
}
/**
* 从文件中读取 Chromosome 对象,并拆分文件读取与反序列化耗时。
*/
......@@ -74,13 +82,7 @@ public class SceneService {
try {
long totalStart = System.nanoTime();
SceneChromsome sceneChromsome = (SceneChromsome) redisUtils.get("SceneId." + sceneId);
File file;
if (sceneChromsome == null) {
file = getChromosomeFile(sceneId);
} else {
file = getChromosomeFile(sceneId, sceneChromsome.getVersion().toString());
}
File file = getCurrentChromosomeFile(sceneId);
if (!file.exists()) {
logger.warn("染色体文件不存在: {}", file.getAbsolutePath());
......
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