Skip to content

Commit

Permalink
Skip heartbeat on /healthz endpoint
Browse files Browse the repository at this point in the history
I managed to lose this in the rewrite.

Fixes #2327.
  • Loading branch information
code-asher committed Nov 18, 2020
1 parent 5e60305 commit 51c3709
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/node/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ export const register = async (
app.use(bodyParser.urlencoded({ extended: true }))

const common: express.RequestHandler = (req, _, next) => {
heart.beat()
// /healthz|/healthz/ needs to be excluded otherwise health checks will make
// it look like code-server is always in use.
if (!/^\/healthz\/?$/.test(req.url)) {
heart.beat()
}

// Add common variables routes can use.
req.args = args
Expand Down

0 comments on commit 51c3709

Please sign in to comment.