Skip to content

Commit

Permalink
Checking for ES plugin readiness before trying to use it
Browse files Browse the repository at this point in the history
If the ES plugin is not ready (i.e. in red state), we won't try to use it and end
up blocking the reply.
  • Loading branch information
ycombinator committed May 25, 2016
1 parent c9fc5de commit 6fa412e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,15 @@ export default async (kbnServer, server, config) => {
basePath: config.get('server.basePath'),
serverName: config.get('server.name'),
uiSettings: {
defaults: await uiSettings.getDefaults(),
user: await uiSettings.getUserProvided()
defaults: await uiSettings.getDefaults()
},
vars: defaults(app.getInjectedVars() || {}, uiExports.defaultInjectedVars),
};

if (server.plugins.elasticsearch.status.state !== 'red') {
payload.uiSettings.user = await uiSettings.getUserProvided();
}

return this.view(app.templateName, {
app: app,
loadingGif: loadingGif,
Expand Down

0 comments on commit 6fa412e

Please sign in to comment.