Add an index of columns user_id and created_at to the library_item table for counting query

This commit is contained in:
Hongbo Wu
2024-07-25 11:18:52 +08:00
parent 6f12b5e406
commit 465e5dc7d1
3 changed files with 17 additions and 3 deletions

View File

@ -760,7 +760,7 @@ export const bulkActionResolver = authorized<
},
})
const batchSize = 50
const batchSize = 20
const searchArgs = {
query,
includePending: true,
@ -779,13 +779,13 @@ export const bulkActionResolver = authorized<
action,
count,
})
// if there are less than 50 items, update them synchronously
// if there are less than batchSize items, update them synchronously
await batchUpdateLibraryItems(action, searchArgs, uid, labelIds, args)
return { success: true }
}
// if there are more than 50 items, update them asynchronously
// if there are more than batchSize items, update them asynchronously
const data = {
userId: uid,
action,