diff --git a/services/web/app.js b/services/web/app.js index 819ad05c12..cf021ab984 100644 --- a/services/web/app.js +++ b/services/web/app.js @@ -49,6 +49,8 @@ if (!module.parent) { Server.server.listen(port, host, function() { logger.info(`web starting up, listening on ${host}:${port}`) logger.info(`${require('http').globalAgent.maxSockets} sockets enabled`) + // wait until the process is ready before monitoring the event loop + metrics.event_loop.monitor(logger) if (argv.user) { process.setuid(argv.user) logger.info(`Running as user: ${argv.user}`) diff --git a/services/web/app/src/infrastructure/Server.js b/services/web/app/src/infrastructure/Server.js index 428d1206f5..f8cdefd8dd 100644 --- a/services/web/app/src/infrastructure/Server.js +++ b/services/web/app/src/infrastructure/Server.js @@ -42,10 +42,6 @@ const STATIC_CACHE_AGE = Settings.cacheStaticAssets // Init the session store const sessionStore = new RedisStore({ client: sessionsRedisClient }) -if (metrics.event_loop != null) { - metrics.event_loop.monitor(logger) -} - const app = express() const webRouter = express.Router()