@@ -438,27 +438,29 @@ public void unlock() {
438
438
}
439
439
440
440
private void removeLockKey () {
441
- try {
442
- if ( RedisLockRegistry . this . unlinkAvailable ) {
441
+ if ( RedisLockRegistry . this . unlinkAvailable ) {
442
+ try {
443
443
RedisLockRegistry .this .redisTemplate .execute (
444
444
RedisLockRegistry .this .unLinkUnLockScript , Collections .singletonList (this .lockKey ),
445
445
RedisLockRegistry .this .unLockChannelKey );
446
+ return ;
446
447
}
447
- }
448
- catch ( Exception ex ) {
449
- RedisLockRegistry . this . unlinkAvailable = false ;
450
- if ( LOGGER .isDebugEnabled ()) {
451
- LOGGER . debug ( "The UNLINK command has failed (not supported on the Redis server?); " +
452
- "falling back to the regular DELETE command" , ex );
453
- }
454
- else {
455
- LOGGER . warn ( "The UNLINK command has failed (not supported on the Redis server?); " +
456
- "falling back to the regular DELETE command: " + ex . getMessage ());
448
+ catch ( Exception ex ) {
449
+ RedisLockRegistry . this . unlinkAvailable = false ;
450
+ if ( LOGGER . isDebugEnabled ()) {
451
+ LOGGER .debug ( "The UNLINK command has failed (not supported on the Redis server?); " +
452
+ "falling back to the regular DELETE command" , ex );
453
+ }
454
+ else {
455
+ LOGGER . warn ( "The UNLINK command has failed (not supported on the Redis server?); " +
456
+ "falling back to the regular DELETE command: " + ex . getMessage ());
457
+ }
457
458
}
458
- RedisLockRegistry .this .redisTemplate .execute (
459
- RedisLockRegistry .this .deleteUnLockScript , Collections .singletonList (this .lockKey ),
460
- RedisLockRegistry .this .unLockChannelKey );
461
459
}
460
+
461
+ RedisLockRegistry .this .redisTemplate .execute (
462
+ RedisLockRegistry .this .deleteUnLockScript , Collections .singletonList (this .lockKey ),
463
+ RedisLockRegistry .this .unLockChannelKey );
462
464
}
463
465
464
466
@ Override
0 commit comments