File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
spring-integration-redis/src/main/java/org/springframework/integration/redis/util Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -476,13 +476,9 @@ public final void unlock() {
476
476
477
477
private void removeLockKey () {
478
478
if (RedisLockRegistry .this .unlinkAvailable ) {
479
+ Boolean unlinkResult = null ;
479
480
try {
480
- boolean unlinkResult = removeLockKeyInnerUnlink ();
481
- if (!unlinkResult ) {
482
- throw new IllegalStateException ("Lock was released in the store due to expiration. " +
483
- "The integrity of data protected by this lock may have been compromised." );
484
- }
485
- return ;
481
+ unlinkResult = removeLockKeyInnerUnlink ();
486
482
}
487
483
catch (Exception ex ) {
488
484
RedisLockRegistry .this .unlinkAvailable = false ;
@@ -495,6 +491,14 @@ private void removeLockKey() {
495
491
"falling back to the regular DELETE command: " + ex .getMessage ());
496
492
}
497
493
}
494
+
495
+ if (Boolean .TRUE .equals (unlinkResult )) {
496
+ return ;
497
+ }
498
+ else if (Boolean .FALSE .equals (unlinkResult )) {
499
+ throw new IllegalStateException ("Lock was released in the store due to expiration. " +
500
+ "The integrity of data protected by this lock may have been compromised." );
501
+ }
498
502
}
499
503
if (!removeLockKeyInnerDelete ()) {
500
504
throw new IllegalStateException ("Lock was released in the store due to expiration. " +
You can’t perform that action at this time.
0 commit comments