提交 58a74d8c 编写于 作者: 冰 河's avatar 冰 河

优化代码

上级 e446d399
......@@ -27,6 +27,9 @@ public class UpdateLockTimeoutTask implements Runnable{
//以传递的线程id为key,当前执行更新超时时间的线程为value,保存到redis中
stringRedisTemplate.opsForValue().set(currentThreadId, String.valueOf(Thread.currentThread().getId()));
while (true){
if (Thread.interrupted()){
break;
}
stringRedisTemplate.expire(key, 30, TimeUnit.SECONDS);
try {
//每个10秒执行一次
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册