mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2025-12-19 04:37:43 +00:00
healthcheck only in k8s
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
|
.vscode/
|
||||||
|
|
||||||
# Runtime data
|
# Runtime data
|
||||||
pids
|
pids
|
||||||
|
|||||||
10
app.js
10
app.js
@@ -170,10 +170,12 @@ srf.use((req, res, next, err) => {
|
|||||||
res.send(500);
|
res.send(500);
|
||||||
});
|
});
|
||||||
|
|
||||||
const PORT = process.env.HTTP_PORT || 3000;
|
if (process.env.K8S) {
|
||||||
const getCount = () => activeCallIds.size;
|
const PORT = process.env.HTTP_PORT || 3000;
|
||||||
const healthCheck = require('@jambonz/http-health-check');
|
const getCount = () => activeCallIds.size;
|
||||||
healthCheck({port: PORT, logger, path: '/', fn: getCount});
|
const healthCheck =
|
||||||
|
healthCheck({port: PORT, logger, path: '/', fn: getCount});
|
||||||
|
}
|
||||||
|
|
||||||
/* update call stats periodically */
|
/* update call stats periodically */
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user