Better handle large numbers of messages in cache on startup

This commit is contained in:
Scott Nonnenberg 2018-09-28 15:51:26 -07:00
parent 102c2717cb
commit 2cfbfe477a
5 changed files with 56 additions and 21 deletions

View file

@ -72,6 +72,7 @@ module.exports = {
getNextExpiringMessage,
getMessagesByConversation,
getUnprocessedCount,
getAllUnprocessed,
getUnprocessedById,
saveUnprocessed,
@ -458,6 +459,10 @@ async function getNextExpiringMessage({ MessageCollection }) {
return new MessageCollection(messages);
}
async function getUnprocessedCount() {
return channels.getUnprocessedCount();
}
async function getAllUnprocessed() {
return channels.getAllUnprocessed();
}