move prerelease check to appstore

This commit is contained in:
Girish Ramakrishnan
2017-10-25 20:52:05 -07:00
parent 9c02785d49
commit b30def3620
8 changed files with 40 additions and 133 deletions
-27
View File
@@ -33,9 +33,6 @@ exports = module.exports = {
getTlsConfig: getTlsConfig,
setTlsConfig: setTlsConfig,
getUpdateConfig: getUpdateConfig,
setUpdateConfig: setUpdateConfig,
getAppstoreConfig: getAppstoreConfig,
setAppstoreConfig: setAppstoreConfig,
@@ -429,30 +426,6 @@ function setBackupConfig(backupConfig, callback) {
});
}
function getUpdateConfig(callback) {
assert.strictEqual(typeof callback, 'function');
settingsdb.get(exports.UPDATE_CONFIG_KEY, function (error, value) {
if (error && error.reason === DatabaseError.NOT_FOUND) return callback(null, gDefaults[exports.UPDATE_CONFIG_KEY]);
if (error) return callback(new SettingsError(SettingsError.INTERNAL_ERROR, error));
callback(null, JSON.parse(value)); // { prerelease }
});
}
function setUpdateConfig(updateConfig, callback) {
assert.strictEqual(typeof updateConfig, 'object');
assert.strictEqual(typeof callback, 'function');
settingsdb.set(exports.UPDATE_CONFIG_KEY, JSON.stringify(updateConfig), function (error) {
if (error) return callback(new SettingsError(SettingsError.INTERNAL_ERROR, error));
exports.events.emit(exports.UPDATE_CONFIG_KEY, updateConfig);
callback(null);
});
}
function getMailConfig(callback) {
assert.strictEqual(typeof callback, 'function');