Skip to content

Commit

Permalink
Merge pull request #29 from EightMonth/master
Browse files Browse the repository at this point in the history
修复#6876
  • Loading branch information
zhangdaiscott authored Aug 22, 2024
2 parents 8d69644 + 37a98ad commit c10785f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ void unlock(String name) {
}

private Boolean doLock(String name, RedisConnection connection) {
return connection.setNX(createCacheLockKey(name), new byte[0]);
// 3分钟后自动删除分布锁KEY
return connection.set(createCacheLockKey(name), new byte[0], Expiration.seconds(180L), SetOption.SET_IF_ABSENT);
}

private Long doUnlock(String name, RedisConnection connection) {
Expand Down

0 comments on commit c10785f

Please sign in to comment.