Skip to content

Commit

Permalink
Add conditional to TLS fallback (OpenUserJS#1287)
Browse files Browse the repository at this point in the history
* Don't start the timer when not secured... been ~64 minutes of pro uptime so realtime PASS and no unexpected results

Post OpenUserJS#1255

Auto-merge
  • Loading branch information
Martii authored Nov 27, 2017
1 parent 4938eec commit e3cd8c0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

0 comments on commit e3cd8c0

Please sign in to comment.