From 2f2e617e4fcf4fe7a18b684e5ef739478c32fd05 Mon Sep 17 00:00:00 2001 From: Roman Zabaluev Date: Tue, 12 Dec 2023 03:50:46 +0700 Subject: [PATCH] Add lock acquisition log message for RedisLockRegistry --- .../integration/redis/util/RedisLockRegistry.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java index d0fa41ba26d..729b855fb2b 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java @@ -85,6 +85,7 @@ * @author Christian Tzolov * @author Eddie Cho * @author Myeonghyeon Lee + * @author Roman Zabaluev * * @since 4.0 * @@ -432,11 +433,14 @@ public final boolean tryLock(long time, TimeUnit unit) throws InterruptedExcepti } private boolean tryRedisLock(long time) throws ExecutionException, InterruptedException { - final boolean result = tryRedisLockInner(time); - if (result) { + final boolean acquired = tryRedisLockInner(time); + if (acquired) { + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("Acquired lock; " + this); + } this.lockedAt = System.currentTimeMillis(); } - return result; + return acquired; } protected final Boolean obtainLock() {