diff --git a/src/backups.js b/src/backups.js index f0f5f3632..dd2a4f151 100644 --- a/src/backups.js +++ b/src/backups.js @@ -269,7 +269,7 @@ function sync(backupConfig, backupId, dataDir, callback) { }); } }, iteratorCallback); - }, 10 /* concurrency */, function (error) { + }, backupConfig.syncConcurrency || 10 /* concurrency */, function (error) { if (error) return callback(new BackupsError(BackupsError.EXTERNAL_ERROR, error.message)); callback(); diff --git a/src/routes/settings.js b/src/routes/settings.js index 850577e3c..264d42934 100644 --- a/src/routes/settings.js +++ b/src/routes/settings.js @@ -153,6 +153,10 @@ function setBackupConfig(req, res, next) { if (typeof req.body.provider !== 'string') return next(new HttpError(400, 'provider is required')); if (typeof req.body.retentionSecs !== 'number') return next(new HttpError(400, 'retentionSecs is required')); if ('key' in req.body && typeof req.body.key !== 'string') return next(new HttpError(400, 'key must be a string')); + if ('syncConcurrency' in req.body) { + if (typeof req.body.syncConcurrency !== 'number') return next(new HttpError(400, 'syncConcurrency must be a positive integer')); + if (req.body.syncConcurrency < 1) return next(new HttpError(400, 'syncConcurrency 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/storage/s3.js b/src/storage/s3.js index bfbc35194..bfb7a4a51 100644 --- a/src/storage/s3.js +++ b/src/storage/s3.js @@ -75,7 +75,8 @@ function getCaasConfig(apiConfig, callback) { customBackoff: () => 20000 // constant backoff - https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#retryDelayOptions-property }, httpOptions: { - connectTimeout: 10000 // https://github.com/aws/aws-sdk-js/pull/1446 + connectTimeout: 10000, // https://github.com/aws/aws-sdk-js/pull/1446 + timeout: 300 * 1000 // https://github.com/aws/aws-sdk-js/issues/1704 (allow 5MB chunk upload to take upto 5 minutes) } }; @@ -107,7 +108,8 @@ function getS3Config(apiConfig, callback) { customBackoff: () => 20000 // constant backoff - https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#retryDelayOptions-property }, httpOptions: { - connectTimeout: 10000 // https://github.com/aws/aws-sdk-js/pull/1446 + connectTimeout: 10000, // https://github.com/aws/aws-sdk-js/pull/1446 + timeout: 300 * 1000 // https://github.com/aws/aws-sdk-js/issues/1704 (allow 5MB chunk upload to take upto 5 minutes) } };