1
0
mirror of synced 2026-10-23 00:17:23 +08:00

🎨 #3932 修复长时间运行时 Redis 命令中断导致 accessToken 刷新失败的问题

This commit is contained in:
Copilot
2026-06-06 20:29:18 +08:00
committed by GitHub
parent cae7d4fbf2
commit 45d529c062
4 changed files with 308 additions and 7 deletions

View File

@@ -42,13 +42,17 @@ public class RedisTemplateSimpleDistributedLock implements Lock {
@Override
public void lock() {
boolean interrupted = false;
while (!tryLock()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// Ignore
interrupted = true;
}
}
if (interrupted) {
Thread.currentThread().interrupt();
}
}
@Override