Skip heartbeat on /healthz endpoint (#2333)

I managed to lose this in the rewrite.

Fixes #2327.
This commit is contained in:
Asher 2020-11-18 12:19:08 -06:00 committed by GitHub
parent c6062c3d0a
commit 2a3608df53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -66,7 +66,11 @@ export const register = async (
app.use(bodyParser.urlencoded({ extended: true }))
const common: express.RequestHandler = (req, _, next) => {
// /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