mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 22:17:14 +03:00
Add seperate config for stopping write redis connections
This commit is contained in:
@@ -137,7 +137,8 @@ addDefaults(config, {
|
||||
disableOfflineQueue: true,
|
||||
expiryTime: 24 * 60 * 60,
|
||||
getTimeout: 40,
|
||||
maxConnections: 15000
|
||||
maxConnections: 15000,
|
||||
maxWriteConnections: 1000
|
||||
},
|
||||
redisRead: {
|
||||
enabled: false,
|
||||
|
||||
@@ -6,6 +6,7 @@ interface RedisConfig extends redis.RedisClientOptions {
|
||||
expiryTime: number;
|
||||
getTimeout: number;
|
||||
maxConnections: number;
|
||||
maxWriteConnections: number;
|
||||
}
|
||||
|
||||
interface RedisReadOnlyConfig extends redis.RedisClientOptions {
|
||||
|
||||
@@ -68,7 +68,7 @@ if (config.redis?.enabled) {
|
||||
});
|
||||
});
|
||||
exportClient.set = (key, value) => new Promise((resolve, reject) => {
|
||||
if (activeRequests > config.redis.maxConnections) {
|
||||
if (activeRequests > config.redis.maxWriteConnections) {
|
||||
reject("Too many active requests");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user