From 64a02c0eb24aa4d3367e92b14c63008bbbb7dfff Mon Sep 17 00:00:00 2001 From: metal Date: Fri, 10 Mar 2023 21:01:39 +0000 Subject: [PATCH] Update backend/src/plugins/Utility/commands/CleanCmd.ts Co-authored-by: Almeida --- backend/src/plugins/Utility/commands/CleanCmd.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/plugins/Utility/commands/CleanCmd.ts b/backend/src/plugins/Utility/commands/CleanCmd.ts index 2b812da8..870e85d4 100644 --- a/backend/src/plugins/Utility/commands/CleanCmd.ts +++ b/backend/src/plugins/Utility/commands/CleanCmd.ts @@ -37,10 +37,10 @@ export async function cleanMessages( const chunks = chunkArray(idsToDelete, 100); await Promise.all( - chunks.map(async (chunk) => { - await channel.bulkDelete(chunk); - await pluginData.state.savedMessages.markBulkAsDeleted(chunk); - }), + chunks.map((chunk) => Promise.all([ + channel.bulkDelete(chunk), + pluginData.state.savedMessages.markBulkAsDeleted(chunk), + ]), ); // Create an archive