Merge pull request #2234 from overleaf/bg-avoid-event-loop-metrics-during-startup

start event loop monitoring when the process is ready

GitOrigin-RevId: 0a7759311b737e99579f61cc4cf90b775c26b76d
This commit is contained in:
Brian Gough 2019-10-14 10:17:07 +01:00 committed by sharelatex
parent 3a4981cbb8
commit 7db9e73ecf
2 changed files with 2 additions and 4 deletions

View file

@ -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}`)

View file

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