mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-27 11:00:48 +00:00
* [misc] fix logger.error(err) calls The signature is "logger.error({ err }, 'MESSAGE')". * [project-history] remove duplicate logger.err calls in health check The call-site is already logging any errors. Also, the logger.err call signature was not quite right. * [web] log userId when removeDropbox/removeGithub hook fails * [misc] fix logger.warn(err) calls The signature is "logger.warn({ err }, 'MESSAGE')". * [misc] fix logger.error(OError.tag(err)) calls * [web] make eslint happy GitOrigin-RevId: 7f528113a3f7e9f6293b7d2d45adc079380325bb
28 lines
836 B
JavaScript
28 lines
836 B
JavaScript
// Metrics must be initialized before importing anything else
|
|
import '@overleaf/metrics/initialize.js'
|
|
|
|
import Settings from '@overleaf/settings'
|
|
import logger from '@overleaf/logger'
|
|
import OError from '@overleaf/o-error'
|
|
import { mongoClient } from './app/js/mongodb.js'
|
|
import { app } from './app/js/server.js'
|
|
|
|
const host = Settings.internal.history.host
|
|
const port = Settings.internal.history.port
|
|
|
|
mongoClient
|
|
.connect()
|
|
.then(() => {
|
|
app.listen(port, host, error => {
|
|
if (error) {
|
|
error = OError.tag(error, 'could not start history server')
|
|
logger.error({ error }, error.message)
|
|
} else {
|
|
logger.debug({}, `history starting up, listening on ${host}:${port}`)
|
|
}
|
|
})
|
|
})
|
|
.catch(err => {
|
|
logger.fatal({ err }, 'Cannot connect to mongo. Exiting.')
|
|
process.exit(1)
|
|
})
|