diff --git a/src/core_plugins/timelion/init.js b/src/core_plugins/timelion/init.js index 9e6a0f1223d13..36fb506d8de62 100644 --- a/src/core_plugins/timelion/init.js +++ b/src/core_plugins/timelion/init.js @@ -4,8 +4,6 @@ var processFunctionDefinition = require('./server/lib/process_function_definitio module.exports = function (server) { //var config = server.config(); - require('./server/lib/populate_config')(server); - require('./server/routes/run.js')(server); require('./server/routes/functions.js')(server); require('./server/routes/validate_es.js')(server); diff --git a/src/core_plugins/timelion/server/lib/populate_config.js b/src/core_plugins/timelion/server/lib/populate_config.js deleted file mode 100644 index c2e323fb9db50..0000000000000 --- a/src/core_plugins/timelion/server/lib/populate_config.js +++ /dev/null @@ -1,35 +0,0 @@ -var _ = require('lodash'); -var getNamespacedSettings = require('./get_namespaced_settings'); - -module.exports = function (server) { - - // Namespace everything in timelion.json - var timelionDefaults = getNamespacedSettings(); - - // Get all existing "advanced settings" - server.uiSettings().getAll().then((existingSettings) => { - - // Find all timelion settings that don't yet exist in kibana's config - var missingKeys = _.reduce(timelionDefaults, (result, value, key) => { - if (existingSettings[key] == null) result.push(key); - return result; - }, []); - - // Recursive function writes one of the missing keys at a time - // If we just spray and pray HTTP requests we will get version conflicts. - function writeMissing(keys) { - - // Pop one key off the missingKeys array unless it is empty - if (!keys.length) return; - var key = keys.pop(); - var timelionDefault = timelionDefaults[key]; - - server.uiSettings() - .set(key, timelionDefault) - .then(() => writeMissing(keys)); - } - - writeMissing(missingKeys); - }); - -};