Skip to content

Commit

Permalink
Merge branch 'development' into chore/improve-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
astsiapanay authored Dec 11, 2024
2 parents 9cd5d8b + b820701 commit 65b9ca3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public LockService(RedissonClient redis, @Nullable String prefix) {
public Lock lock(String key) {
String id = id(key);
long owner = ThreadLocalRandom.current().nextLong();
log.info("Thread {} acquires a lock to the resource {} with owner {}", Thread.currentThread().getName(), id, owner);
long ttl = tryLock(id, owner);
long interval = WAIT_MIN;

Expand Down Expand Up @@ -108,6 +109,8 @@ private void unlock(String id, long owner) {
boolean ok = tryUnlock(id, owner);
if (!ok) {
log.error("Lock service failed to unlock: {}", id);
} else {
log.info("Thread {} releases a lock to the resource {} with owner {}", Thread.currentThread().getName(), id, owner);
}
}

Expand Down

0 comments on commit 65b9ca3

Please sign in to comment.