mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-08 19:50:47 +00:00
Merge pull request #12 from overleaf/spd-async-pool-empty-array
Don't try to delete files if none are found in a directory
This commit is contained in:
commit
9f28adf96c
1 changed files with 9 additions and 3 deletions
|
@ -220,9 +220,15 @@ module.exports = class GcsPersistor extends AbstractPersistor {
|
|||
.bucket(bucketName)
|
||||
.getFiles({ directory: key })
|
||||
|
||||
await asyncPool(this.settings.deleteConcurrency, files, async (file) => {
|
||||
await this.deleteObject(bucketName, file.name)
|
||||
})
|
||||
if (Array.isArray(files) && files.length > 0) {
|
||||
await asyncPool(
|
||||
this.settings.deleteConcurrency,
|
||||
files,
|
||||
async (file) => {
|
||||
await this.deleteObject(bucketName, file.name)
|
||||
}
|
||||
)
|
||||
}
|
||||
} catch (err) {
|
||||
const error = PersistorHelper.wrapError(
|
||||
err,
|
||||
|
|
Loading…
Add table
Reference in a new issue