backups: make noop upload work again
This commit is contained in:
@@ -21,7 +21,8 @@ exports = module.exports = {
|
||||
|
||||
const assert = require('assert'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
debug = require('debug')('box:storage/noop');
|
||||
debug = require('debug')('box:storage/noop'),
|
||||
fs = require('fs');
|
||||
|
||||
async function getProviderStatus(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
@@ -35,15 +36,18 @@ async function getAvailableSize(apiConfig) {
|
||||
return Number.POSITIVE_INFINITY;
|
||||
}
|
||||
|
||||
function upload(apiConfig, backupFilePath, sourceStream, callback) {
|
||||
async function upload(apiConfig, backupFilePath) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof backupFilePath, 'string');
|
||||
assert.strictEqual(typeof sourceStream, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
debug('upload: %s', backupFilePath);
|
||||
debug(`upload: ${backupFilePath}`);
|
||||
|
||||
callback(null);
|
||||
const uploadStream = fs.createWriteStream('/dev/null');
|
||||
|
||||
return {
|
||||
stream: uploadStream,
|
||||
async finish() {}
|
||||
};
|
||||
}
|
||||
|
||||
async function exists(apiConfig, backupFilePath) {
|
||||
|
||||
Reference in New Issue
Block a user