backups: remove entries from database that don't exist in storage

fixes #772
This commit is contained in:
Girish Ramakrishnan
2021-02-18 16:51:43 -08:00
parent a5c4b5d8a1
commit c4dffa393b
7 changed files with 212 additions and 43 deletions

View File

@@ -11,23 +11,25 @@
// for the other API calls we leave it to the backend to retry. this allows
// them to tune the concurrency based on failures/rate limits accordingly
exports = module.exports = {
getBackupPath: getBackupPath,
checkPreconditions: checkPreconditions,
getBackupPath,
checkPreconditions,
upload: upload,
upload,
download: download,
downloadDir: downloadDir,
copy: copy,
exists,
listDir: listDir,
download,
downloadDir,
copy,
remove: remove,
removeDir: removeDir,
listDir,
testConfig: testConfig,
removePrivateFields: removePrivateFields,
injectPrivateFields: injectPrivateFields
remove,
removeDir,
testConfig,
removePrivateFields,
injectPrivateFields
};
var assert = require('assert'),
@@ -72,6 +74,14 @@ function upload(apiConfig, backupFilePath, sourceStream, callback) {
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'upload is not implemented'));
}
function exists(apiConfig, backupFilePath, callback) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof backupFilePath, 'string');
assert.strictEqual(typeof callback, 'function');
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'exists is not implemented'));
}
function download(apiConfig, backupFilePath, callback) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof backupFilePath, 'string');