mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 12:07:07 +03:00
Allow no max redis connections
This commit is contained in:
@@ -53,7 +53,7 @@ if (config.redis?.enabled) {
|
|||||||
const get = client.get.bind(client);
|
const get = client.get.bind(client);
|
||||||
const getRead = readClient?.get?.bind(readClient);
|
const getRead = readClient?.get?.bind(readClient);
|
||||||
exportClient.get = (key) => new Promise((resolve, reject) => {
|
exportClient.get = (key) => new Promise((resolve, reject) => {
|
||||||
if (activeRequests > config.redis.maxConnections) {
|
if (config.redis.maxConnections && activeRequests > config.redis.maxConnections) {
|
||||||
reject("Too many active requests");
|
reject("Too many active requests");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ if (config.redis?.enabled) {
|
|||||||
|
|
||||||
const setFun = <T extends Array<any>>(func: (...args: T) => Promise<string> , params: T): Promise<string> =>
|
const setFun = <T extends Array<any>>(func: (...args: T) => Promise<string> , params: T): Promise<string> =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
if (activeRequests > config.redis.maxWriteConnections) {
|
if (config.redis.maxWriteConnections && activeRequests > config.redis.maxWriteConnections) {
|
||||||
reject("Too many active requests");
|
reject("Too many active requests");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user