Use throwOnTimeout option for PQueue

This commit is contained in:
Fedor Indutny 2021-11-23 23:01:03 +01:00 committed by GitHub
parent bd6ee4b16d
commit 76a30a5196
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 54 additions and 10 deletions

View file

@ -781,7 +781,11 @@ export class ConversationController {
`ConversationController: Removing ${temporaryConversations.length} temporary conversations`
);
}
const queue = new PQueue({ concurrency: 3, timeout: 1000 * 60 * 2 });
const queue = new PQueue({
concurrency: 3,
timeout: 1000 * 60 * 2,
throwOnTimeout: true,
});
queue.addAll(
temporaryConversations.map(item => async () => {
await removeConversation(item.id, {