1
0
mirror of synced 2026-04-12 04:04:10 +08:00

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Binary Wang
2026-03-21 16:25:24 +08:00
committed by GitHub
parent e9ac624022
commit 8ec7cb8e4b

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) {
Thread.currentThread().interrupt();
interrupted = true;
}
}
if (interrupted) {
Thread.currentThread().interrupt();
}
}
@Override