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,
|
||||
@@ -23,7 +24,6 @@ exports = module.exports = {
|
||||
|
||||
const assert = require('assert'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
DataLayout = require('../datalayout.js'),
|
||||
debug = require('debug')('box:storage/noop');
|
||||
|
||||
function getBackupRootPath(apiConfig) {
|
||||
@@ -31,9 +31,16 @@ function getBackupRootPath(apiConfig) {
|
||||
return '';
|
||||
}
|
||||
|
||||
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