Better handle large numbers of messages in cache on startup
This commit is contained in:
parent
102c2717cb
commit
2cfbfe477a
5 changed files with 56 additions and 21 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -939,6 +939,9 @@
|
|||
},
|
||||
|
||||
// Not yet processed messages - for resiliency
|
||||
getUnprocessedCount() {
|
||||
return window.Signal.Data.getUnprocessedCount();
|
||||
},
|
||||
getAllUnprocessed() {
|
||||
return window.Signal.Data.getAllUnprocessed();
|
||||
},
|
||||
|
@ -959,6 +962,9 @@
|
|||
removeUnprocessed(id) {
|
||||
return window.Signal.Data.removeUnprocessed(id, { Unprocessed });
|
||||
},
|
||||
removeAllUnprocessed() {
|
||||
return window.Signal.Data.removeAllUnprocessed();
|
||||
},
|
||||
async removeAllData() {
|
||||
// First the in-memory caches:
|
||||
window.storage.reset(); // items store
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue