mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-23 13:21:37 +00:00
Don't pass empty array to asyncPool when archiving
This commit is contained in:
parent
e4d7c253c0
commit
1575cd41eb
1 changed files with 6 additions and 5 deletions
|
@ -39,11 +39,12 @@ async function archiveAllDocs(projectId) {
|
|||
throw new Errors.NotFoundError(`No docs for project ${projectId}`)
|
||||
}
|
||||
|
||||
await asyncPool(
|
||||
PARALLEL_JOBS,
|
||||
docs.filter((doc) => !doc.inS3),
|
||||
(doc) => archiveDoc(projectId, doc)
|
||||
)
|
||||
const docsToArchive = docs.filter((doc) => !doc.inS3)
|
||||
if (docsToArchive.length) {
|
||||
await asyncPool(PARALLEL_JOBS, docsToArchive, (doc) =>
|
||||
archiveDoc(projectId, doc)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
async function archiveDoc(projectId, doc) {
|
||||
|
|
Loading…
Reference in a new issue