You've already forked FrameTour-BE
逻辑调整
This commit is contained in:
@ -13,6 +13,7 @@ import org.springframework.stereotype.Component;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@ -33,7 +34,7 @@ public class FaceRepository {
|
||||
}
|
||||
FaceEntity face = faceMapper.get(id);
|
||||
if (face != null) {
|
||||
redisTemplate.opsForValue().set(String.format(FACE_CACHE_KEY, id), JSONObject.toJSONString(face));
|
||||
redisTemplate.opsForValue().set(String.format(FACE_CACHE_KEY, id), JSONObject.toJSONString(face), 60 * 60 * 24L, TimeUnit.SECONDS);
|
||||
}
|
||||
return face;
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Component
|
||||
public class VideoTaskRepository {
|
||||
@Autowired
|
||||
@ -23,7 +25,7 @@ public class VideoTaskRepository {
|
||||
} else {
|
||||
TaskEntity task = taskMapper.get(taskId);
|
||||
if (task != null && 1 == task.getStatus()) {
|
||||
redisTemplate.opsForValue().set(String.format(TASK_CACHE_KEY, taskId), JSONObject.toJSONString(task));
|
||||
redisTemplate.opsForValue().set(String.format(TASK_CACHE_KEY, taskId), JSONObject.toJSONString(task), 60 * 60 * 24L, TimeUnit.SECONDS);
|
||||
}
|
||||
return task;
|
||||
}
|
||||
|
Reference in New Issue
Block a user