mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Support v5 of mongodb when recording metrics
GitOrigin-RevId: 6365fa54b0b50dc8527fe75f371c53a43e2c5a72
This commit is contained in:
parent
da350a52fd
commit
56f70b3246
1 changed files with 2 additions and 1 deletions
|
@ -65,7 +65,8 @@ function monitor(mongoClient) {
|
||||||
const servers = mongoClient.topology?.s?.servers
|
const servers = mongoClient.topology?.s?.servers
|
||||||
if (servers != null) {
|
if (servers != null) {
|
||||||
for (const [address, server] of servers) {
|
for (const [address, server] of servers) {
|
||||||
const pool = server.s?.pool
|
// The server object is different between v4 and v5 (c.f. https://github.com/mongodb/node-mongodb-native/pull/3645)
|
||||||
|
const pool = server.s?.pool || server.pool
|
||||||
if (pool == null) {
|
if (pool == null) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue