diff --git a/src/routes/settings.js b/src/routes/settings.js index 7903f435e..5ae4a60c3 100644 --- a/src/routes/settings.js +++ b/src/routes/settings.js @@ -111,6 +111,10 @@ function setBackupConfig(req, res, next) { if (typeof req.body.downloadConcurrency !== 'number') return next(new HttpError(400, 'downloadConcurrency must be a positive integer')); if (req.body.downloadConcurrency < 1) return next(new HttpError(400, 'downloadConcurrency must be a positive integer')); } + if ('deleteConcurrency' in req.body) { + if (typeof req.body.deleteConcurrency !== 'number') return next(new HttpError(400, 'deleteConcurrency must be a positive integer')); + if (req.body.deleteConcurrency < 1) return next(new HttpError(400, 'deleteConcurrency must be a positive integer')); + } if ('memoryLimit' in req.body && typeof req.body.memoryLimit !== 'number') return next(new HttpError(400, 'memoryLimit must be a positive integer')); if (typeof req.body.format !== 'string') return next(new HttpError(400, 'format must be a string')); if ('acceptSelfSignedCerts' in req.body && typeof req.body.acceptSelfSignedCerts !== 'boolean') return next(new HttpError(400, 'format must be a boolean')); diff --git a/src/settings.js b/src/settings.js index 1468954d1..8bf0f8720 100644 --- a/src/settings.js +++ b/src/settings.js @@ -437,7 +437,7 @@ function setBackupCredentials(credentials, callback) { if (error) return callback(error); // preserve these fields - const extra = _.pick(currentConfig, 'retentionPolicy', 'schedulePattern', 'copyConcurrency', 'syncConcurrency', 'memoryLimit', 'downloadConcurrency'); + const extra = _.pick(currentConfig, 'retentionPolicy', 'schedulePattern', 'copyConcurrency', 'syncConcurrency', 'memoryLimit', 'downloadConcurrency', 'deleteConcurrency'); const backupConfig = _.extend({}, credentials, extra); diff --git a/src/storage/s3.js b/src/storage/s3.js index 014dc5a05..978d03a60 100644 --- a/src/storage/s3.js +++ b/src/storage/s3.js @@ -396,7 +396,7 @@ function removeDir(apiConfig, pathPrefix) { listDir(apiConfig, pathPrefix, 1000, function listDirIterator(entries, done) { total += entries.length; - const chunkSize = apiConfig.provider !== 'digitalocean-spaces' ? 1000 : 100; // throttle objects in each request + const chunkSize = apiConfig.deleteConcurrency || (apiConfig.provider !== 'digitalocean-spaces' ? 1000 : 100); // throttle objects in each request var chunks = chunk(entries, chunkSize); async.eachSeries(chunks, function deleteFiles(objects, iteratorCallback) {