mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-23 14:01:52 +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}`)
|
throw new Errors.NotFoundError(`No docs for project ${projectId}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
await asyncPool(
|
const docsToArchive = docs.filter((doc) => !doc.inS3)
|
||||||
PARALLEL_JOBS,
|
if (docsToArchive.length) {
|
||||||
docs.filter((doc) => !doc.inS3),
|
await asyncPool(PARALLEL_JOBS, docsToArchive, (doc) =>
|
||||||
(doc) => archiveDoc(projectId, doc)
|
archiveDoc(projectId, doc)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function archiveDoc(projectId, doc) {
|
async function archiveDoc(projectId, doc) {
|
||||||
|
|
Loading…
Reference in a new issue