You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/RedisStringsHandler.ts
+15-12Lines changed: 15 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -30,18 +30,21 @@ export function redisErrorHandler<T extends Promise<unknown>>(
30
30
})asT;
31
31
}
32
32
33
-
// This is a test to check if the event loop is lagging. If it lags, increase CPU of container
34
-
setInterval(()=>{
35
-
conststart=performance.now();
36
-
setImmediate(()=>{
37
-
constduration=performance.now()-start;
38
-
if(duration>100){
39
-
console.warn(
40
-
`RedisStringsHandler detected an event loop lag of: ${duration.toFixed(2)}ms`,
41
-
);
42
-
}
43
-
});
44
-
},10);
33
+
if(process.env.DEBUG_CACHE_HANDLER){
34
+
// This is a test to check if the event loop is lagging. If it lags, increase CPU of container
35
+
setInterval(()=>{
36
+
conststart=performance.now();
37
+
setImmediate(()=>{
38
+
constduration=performance.now()-start;
39
+
if(duration>100){
40
+
debug(
41
+
'yellow',
42
+
`RedisStringsHandler detected an event loop lag of: ${duration.toFixed(2)}ms. If your container is hosted in a cloud provider with container suspension this is normal. If not you should increase the CPU of your container.`,
0 commit comments