1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2024-12-28 05:05:25 +00:00

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

View File

@ -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