Remove backup download code

This commit is contained in:
Johannes Zellner
2017-04-22 22:17:29 +02:00
parent 8c011ea9b0
commit a7d7935451
8 changed files with 2 additions and 198 deletions

View File

@@ -6,8 +6,6 @@ exports = module.exports = {
copyBackup: copyBackup,
removeBackup: removeBackup,
getDownloadStream: getDownloadStream,
backupDone: backupDone,
testConfig: testConfig
@@ -154,21 +152,6 @@ function removeBackup(apiConfig, backupId, appBackupIds, callback) {
}, callback);
}
function getDownloadStream(apiConfig, backupId, callback) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof backupId, 'string');
assert.strictEqual(typeof callback, 'function');
var backupFilePath = getBackupFilePath(apiConfig, backupId);
debug('[%s] getDownloadStream: %s %s', backupId, backupId, backupFilePath);
if (!fs.existsSync(backupFilePath)) return callback(new BackupsError(BackupsError.NOT_FOUND, 'backup file does not exist'));
var stream = fs.createReadStream(backupFilePath);
callback(null, stream);
}
function testConfig(apiConfig, callback) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof callback, 'function');