From e3cd8c045338772b3a1f82e7c41c91e9558c5890 Mon Sep 17 00:00:00 2001 From: Marti Martz Date: Mon, 27 Nov 2017 03:44:57 -0700 Subject: [PATCH] Add conditional to TLS fallback (#1287) * Don't start the timer when not secured... been ~64 minutes of pro uptime so realtime PASS and no unexpected results Post #1255 Auto-merge --- app.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 584ecf721..38d1982d0 100755 --- a/app.js +++ b/app.js @@ -116,8 +116,10 @@ function beforeExit() { * Attempt to get everything closed before process exit */ - // Cancel intervals - clearInterval(pingCertTimer); + // Cancel any intervals + if (pingCertTimer) { + clearInterval(pingCertTimer); + } // Close the db connection db.close(); // NOTE: Current asynchronous but auth may prevent callback until completed @@ -459,4 +461,6 @@ function pingCert() { }); }; -pingCertTimer = setInterval(pingCert, 60 * 60 * 1000); // NOTE: Check every hour +if (secured) { + pingCertTimer = setInterval(pingCert, 60 * 60 * 1000); // NOTE: Check every hour +}