mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
74eeec2ba3
Mongo connection pool monitoring GitOrigin-RevId: 050e50e7e67061ccbf39a710ca4532eafd423365
15 lines
396 B
JavaScript
15 lines
396 B
JavaScript
import Metrics from '@overleaf/metrics'
|
|
import Settings from '@overleaf/settings'
|
|
import { MongoClient } from 'mongodb'
|
|
|
|
export { ObjectId } from 'mongodb'
|
|
|
|
export const mongoClient = new MongoClient(Settings.mongo.url)
|
|
const mongoDb = mongoClient.db()
|
|
|
|
export const db = {
|
|
messages: mongoDb.collection('messages'),
|
|
rooms: mongoDb.collection('rooms'),
|
|
}
|
|
|
|
Metrics.mongodb.monitor(mongoClient)
|