split checkPrecondition so it can be used in cleaner as well
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
exports = module.exports = {
|
||||
getBackupRootPath,
|
||||
checkBackupPreconditions,
|
||||
getBackupProviderStatus,
|
||||
getAvailableSize,
|
||||
|
||||
upload,
|
||||
exists,
|
||||
@@ -31,7 +32,6 @@ const assert = require('assert'),
|
||||
AwsSdk = require('aws-sdk'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
constants = require('../constants.js'),
|
||||
DataLayout = require('../datalayout.js'),
|
||||
debug = require('debug')('box:storage/s3'),
|
||||
https = require('https'),
|
||||
path = require('path'),
|
||||
@@ -98,9 +98,16 @@ function getBackupRootPath(apiConfig) {
|
||||
return apiConfig.prefix;
|
||||
}
|
||||
|
||||
async function checkBackupPreconditions(apiConfig, dataLayout) {
|
||||
async function getBackupProviderStatus(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert(dataLayout instanceof DataLayout, 'dataLayout must be a DataLayout');
|
||||
|
||||
return { state: 'active' };
|
||||
}
|
||||
|
||||
async function getAvailableSize(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
|
||||
return Number.POSITIVE_INFINITY;
|
||||
}
|
||||
|
||||
function upload(apiConfig, backupFilePath, sourceStream, callback) {
|
||||
|
||||
Reference in New Issue
Block a user