Add logging when too many active connections

This commit is contained in:
Ajay 2024-02-09 14:54:14 -05:00
parent a74189b287
commit 17b002649e

View file

@ -183,7 +183,7 @@ if (config.redis?.enabled) {
const getRead = readClient?.get?.bind(readClient);
exportClient.get = (key) => new Promise((resolve, reject) => {
if (config.redis.maxConnections && activeRequests > config.redis.maxConnections) {
reject(new TooManyActiveConnectionsError("Too many active requests in general"));
reject(new TooManyActiveConnectionsError(`Too many active requests in general: ${activeRequests} over ${config.redis.maxConnections}`));
return;
}