Skip to content

Commit

Permalink
Update RedisUtil.java
Browse files Browse the repository at this point in the history
  • Loading branch information
RockyLOMO committed Apr 20, 2024
1 parent a99fa62 commit baf2596
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rxlib-x/src/main/java/org/rx/redis/RedisUtil.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.rx.redis;

import com.google.common.util.concurrent.RateLimiter;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock;
import org.rx.core.Cache;
import org.rx.core.Strings;
Expand All @@ -11,10 +12,12 @@
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

@Slf4j
public class RedisUtil {
public static Lock wrapLock(RLock rLock) {
return Sys.fallbackProxy(Lock.class, rLock, new Lazy<>(ReentrantLock::new), e -> {
if (Strings.hashEquals(e.getMethod().getName(), "unlock")) {
log.debug("fallbackProxy wrapLock", e.getFallbackError());
return null;
}
throw e;
Expand Down

0 comments on commit baf2596

Please sign in to comment.