Skip to content
Snippets Groups Projects
Commit 88cb0b67 authored by Guilherme Gazzo's avatar Guilherme Gazzo Committed by Guilherme Gazzo
Browse files

[FIX] Fix watch db being started on Micro Services env (#27435)

parent 161f9601
No related branches found
No related tags found
No related merge requests found
import { WebApp } from 'meteor/webapp';
import { isLastDocDelayed } from '../startup/watchDb';
import { isRunningMs } from '../lib/isRunningMs';
WebApp.rawConnectHandlers.use('/health', function (_req, res) {
WebApp.rawConnectHandlers.use('/health', async function (_req, res) {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
res.setHeader('Pragma', 'no-cache');
res.setHeader('Expires', 0);
res.setHeader('Content-Type', 'text/plain');
if (isLastDocDelayed()) {
res.writeHead(500);
res.end('not healthy');
return;
if (!isRunningMs()) {
const { isLastDocDelayed } = await import('../startup/watchDb');
if (isLastDocDelayed()) {
res.writeHead(500);
res.end('not healthy');
return;
}
}
res.end('ok');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment