Skip to content

Commit 2a3608d

Browse files
authored
Skip heartbeat on /healthz endpoint (coder#2333)
I managed to lose this in the rewrite. Fixes coder#2327.
1 parent c6062c3 commit 2a3608d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/node/routes/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ export const register = async (
6666
app.use(bodyParser.urlencoded({ extended: true }))
6767

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

7175
// Add common variables routes can use.
7276
req.args = args

0 commit comments

Comments
 (0)