Commit 57ff3850 by 陈健智

舆情分析-词云增加重生成逻辑

parent 64f6f90d
......@@ -3105,7 +3105,13 @@ public class MarkDataServiceImpl implements MarkDataService {
String resultStr;
// 返回缓存
if (cache && StringUtils.isNotEmpty(resultStr = redisUtil.get(redisKey))) {
return JSONArray.parseArray(resultStr, JSONObject.class);
List<JSONObject> res = JSONArray.parseArray(resultStr, JSONObject.class);
// 缓存为空,尝试重新生成
if (CollectionUtils.isEmpty(res)){
res = generateHighWord(dto);
redisUtil.setExpire(redisKey, JSONArray.toJSONString(res));
}
return res;
}
List<JSONObject> res = generateHighWord(dto);
redisUtil.setExpire(redisKey, JSONArray.toJSONString(res));
......@@ -3122,7 +3128,7 @@ public class MarkDataServiceImpl implements MarkDataService {
while (!existTask.getFinish()) {
existTask = markSearchAnalyzeTaskDao.findOne("searchFilterDTO", dto);
long eTime = System.currentTimeMillis();
if (existTask.getFinish() || eTime - sTime >= 3 * 60 * 1000) {
if (Objects.isNull(existTask) || existTask.getFinish() || eTime - sTime >= 3 * 60 * 1000) {
break;
}
Thread.sleep(10000L);
......
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