healthcheck only in k8s

This commit is contained in:
Dave Horton
2022-01-22 21:43:18 -05:00
parent 50ff35c582
commit 2ca44c4f5a

10
app.js
View File

@@ -136,10 +136,12 @@ srf.invite((req, res) => {
session.connect();
});
const PORT = process.env.HTTP_PORT || 3000;
const getCount = () => activeCallIds.size;
const healthCheck = require('@jambonz/http-health-check');
healthCheck({port: PORT, logger, path: '/', fn: getCount});
if (process.env.K8S) {
const PORT = process.env.HTTP_PORT || 3000;
const getCount = () => activeCallIds.size;
const healthCheck = require('@jambonz/http-health-check');
healthCheck({port: PORT, logger, path: '/', fn: getCount});
}
/* update call stats periodically */
setInterval(() => {