@@ -29,7 +29,6 @@ exports = module.exports = {
|
||||
|
||||
getBackupConfig,
|
||||
setBackupConfig,
|
||||
setBackupCredentials,
|
||||
|
||||
getServicesConfig,
|
||||
setServicesConfig,
|
||||
@@ -485,23 +484,6 @@ async function setBackupConfig(backupConfig) {
|
||||
notifyChange(exports.BACKUP_CONFIG_KEY, backupConfig);
|
||||
}
|
||||
|
||||
async function setBackupCredentials(credentials) {
|
||||
assert.strictEqual(typeof credentials, 'object');
|
||||
|
||||
const currentConfig = await getBackupConfig();
|
||||
|
||||
// preserve these fields
|
||||
const extra = _.pick(currentConfig, 'copyConcurrency', 'syncConcurrency', 'memoryLimit', 'downloadConcurrency', 'deleteConcurrency', 'uploadPartSize');
|
||||
|
||||
const backupConfig = Object.assign({}, credentials, extra);
|
||||
|
||||
backups.cleanupCacheFilesSync();
|
||||
|
||||
await set(exports.BACKUP_CONFIG_KEY, JSON.stringify(backupConfig));
|
||||
|
||||
notifyChange(exports.BACKUP_CONFIG_KEY, backupConfig);
|
||||
}
|
||||
|
||||
async function getServicesConfig() {
|
||||
const value = await get(exports.SERVICES_CONFIG_KEY);
|
||||
if (value === null) return gDefaults[exports.SERVICES_CONFIG_KEY];
|
||||
|
||||
Reference in New Issue
Block a user