mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-09 04:57:04 +03:00
Rename config for clientCacheSize
This commit is contained in:
@@ -167,7 +167,7 @@ addDefaults(config, {
|
||||
stopWritingAfterResponseTime: 50,
|
||||
responseTimePause: 1000,
|
||||
disableHashCache: false,
|
||||
clientCacheLength: 2000
|
||||
clientCacheSize: 2000
|
||||
},
|
||||
redisRead: {
|
||||
enabled: false,
|
||||
|
||||
@@ -11,7 +11,7 @@ interface RedisConfig extends redis.RedisClientOptions {
|
||||
stopWritingAfterResponseTime: number;
|
||||
responseTimePause: number;
|
||||
disableHashCache: boolean;
|
||||
clientCacheLength: number;
|
||||
clientCacheSize: number;
|
||||
}
|
||||
|
||||
interface RedisReadOnlyConfig extends redis.RedisClientOptions {
|
||||
|
||||
@@ -61,8 +61,8 @@ const writeResponseTime: number[] = [];
|
||||
let lastResponseTimeLimit = 0;
|
||||
const maxStoredTimes = 200;
|
||||
|
||||
const cache = config.redis.clientCacheLength ? new LRUCache<RedisCommandArgument, string>({
|
||||
maxSize: config.redis.clientCacheLength,
|
||||
const cache = config.redis.clientCacheSize ? new LRUCache<RedisCommandArgument, string>({
|
||||
maxSize: config.redis.clientCacheSize,
|
||||
sizeCalculation: (value) => value.length
|
||||
}) : null;
|
||||
|
||||
@@ -248,7 +248,7 @@ if (config.redis?.enabled) {
|
||||
void cacheClient.connect();
|
||||
};
|
||||
|
||||
if (config.redis.clientCacheLength) {
|
||||
if (config.redis.clientCacheSize) {
|
||||
createCacheClient();
|
||||
|
||||
client.on("ready", () => {
|
||||
|
||||
Reference in New Issue
Block a user