From d0b040fbb92246bb752dcc573d897109b0730278 Mon Sep 17 00:00:00 2001 From: Yonle Date: Wed, 24 Jan 2024 16:32:41 +0700 Subject: [PATCH] bouncer: logger: no need to tell clearing orphan sessions when max_orphan_sess is 0. Signed-off-by: Yonle --- bouncer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bouncer.js b/bouncer.js index d28229d..94d5ff8 100644 --- a/bouncer.js +++ b/bouncer.js @@ -244,7 +244,7 @@ function onClientDisconnect() { const orphanSessNum = howManyOrphanSess(); const max = max_orphan_sess || 0; if (orphanSessNum > max) { - console.log(process.pid, `There are ${orphanSessNum} orphan sessions. I will clear ${orphanSessNum - max} orphan sessions.`); + if (max) console.log(process.pid, `There are ${orphanSessNum} orphan sessions. I will clear ${orphanSessNum - max} orphan sessions.`); clearOrphanSess(orphanSessNum - max); } }