From e323a22666acef190b8892a5b87fd9d8d1775755 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween <5454374+emcsween@users.noreply.github.com> Date: Thu, 4 May 2023 07:29:58 -0400 Subject: [PATCH] Merge pull request #12932 from overleaf/em-history-chunks-project-deletion Use index when deleting project history chunks GitOrigin-RevId: 804b8fe8da8bab04a4c0e9fe0008c5554b51817e --- services/history-v1/storage/lib/chunk_store/mongo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/history-v1/storage/lib/chunk_store/mongo.js b/services/history-v1/storage/lib/chunk_store/mongo.js index 29d522564c..7916ef00df 100644 --- a/services/history-v1/storage/lib/chunk_store/mongo.js +++ b/services/history-v1/storage/lib/chunk_store/mongo.js @@ -189,7 +189,7 @@ async function deleteProjectChunks(projectId) { assert.mongoId(projectId, 'bad projectId') await mongodb.chunks.updateMany( - { projectId: ObjectId(projectId) }, + { projectId: ObjectId(projectId), state: 'active' }, { $set: { state: 'deleted', updatedAt: new Date() } } ) }