backups: make noop upload work again

This commit is contained in:
Girish Ramakrishnan
2024-08-12 10:05:14 +02:00
parent 4dae3447d6
commit 041f7da59b

View File

@@ -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) {