mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Don't try to delete files if none are found in a directory
This commit is contained in:
parent
65c5793b48
commit
60931b86c3
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…
Reference in a new issue