Change RedisLockRegistry cache to 100K

1_000_000 of cache entries take too much memory
This commit is contained in:
Unseok Kim
2021-11-12 00:54:56 +09:00
committed by GitHub
parent 85efb5f53c
commit 3c812440cf

View File

@@ -80,7 +80,7 @@ public final class RedisLockRegistry implements ExpirableLockRegistry, Disposabl
private static final long DEFAULT_EXPIRE_AFTER = 60000L;
private static final int DEFAULT_CAPACITY = 1_000_000;
private static final int DEFAULT_CAPACITY = 100_000;
private static final String OBTAIN_LOCK_SCRIPT =
"local lockClientId = redis.call('GET', KEYS[1])\n" +
@@ -168,7 +168,7 @@ public final class RedisLockRegistry implements ExpirableLockRegistry, Disposabl
/**
* Set the capacity of cached locks.
* @param capacity The capacity of cached lock, (default 1_000_000).
* @param capacity The capacity of cached lock, (default 100_000).
* @since 5.5.6
*/
public void setCapacity(int capacity) {