Skip to content

Commit 3c9aa2a

Browse files
authored
fix(messages-api-timeout): Add maxTimeMS timeout to mongopaging queries in messages api ZMS-204 (#799)
* add maxTimeMS timeout to mongopaging queries in messages api * added timeouts should be using DB_MAX_TIME_MESSAGES
1 parent d91f112 commit 3c9aa2a

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

lib/api/messages.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,8 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti
562562
thread: true,
563563
flags: true,
564564
verificationResults: true
565-
}
565+
},
566+
maxTimeMS: consts.DB_MAX_TIME_MESSAGES
566567
},
567568
paginatedField: 'idate',
568569
sortAscending
@@ -882,7 +883,8 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti
882883
thread: true,
883884
flags: true,
884885
verificationResults: true
885-
}
886+
},
887+
maxTimeMS: consts.DB_MAX_TIME_MESSAGES
886888
},
887889
paginatedField: order !== undefined ? 'idate' : '_id',
888890
sortAscending: order === 'asc' ? true : undefined
@@ -3084,7 +3086,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti
30843086
projection: {
30853087
uid: true,
30863088
flags: true,
3087-
thread: true,
3089+
thread: true
30883090
}
30893091
}
30903092
);
@@ -3397,7 +3399,8 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti
33973399
draft: true,
33983400
thread: true,
33993401
flags: true
3400-
}
3402+
},
3403+
maxTimeMS: consts.DB_MAX_TIME_MESSAGES
34013404
},
34023405
paginatedField: '_id',
34033406
sortAscending

0 commit comments

Comments
 (0)