Placate the linter

GitOrigin-RevId: 064d796a5c3c49cfdacee5cf1a461d38f08425b3
This commit is contained in:
andrew rumble 2024-08-02 18:41:39 +01:00 committed by Copybot
parent 4e2bfd58a1
commit d4cc50bc21

View file

@ -21,9 +21,16 @@ const connectionPromise = mongoose.connect(
Settings.mongo.options
)
connectionPromise.then(mongooseInstance => {
connectionPromise
.then(mongooseInstance => {
Metrics.mongodb.monitor(mongooseInstance.connection.client)
})
.catch(error => {
logger.error(
{ error },
'Failed to connect to MongoDB - cannot set up monitoring'
)
})
addConnectionDrainer('mongoose', async () => {
await connectionPromise