Skip to content

Commit

Permalink
[ingest/register_fields_capabilities] prevent calling reply() twice
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Sep 30, 2016
1 parent a23cd39 commit e06e659
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ export function registerFieldCapabilities(server) {
index: indices,
allowNoIndices: false
})
.catch((error) => {
reply(handleESError(error));
})
.then((res) => {
const fields = _.get(res, 'indices._all.fields', {});
const fieldsFilteredValues = _.mapValues(fields, (value) => {
return _.pick(value, ['searchable', 'aggregatable']);
});
.then(
(res) => {
const fields = _.get(res, 'indices._all.fields', {});
const fieldsFilteredValues = _.mapValues(fields, (value) => {
return _.pick(value, ['searchable', 'aggregatable']);
});

reply({fields: fieldsFilteredValues});
});
reply({fields: fieldsFilteredValues});
},
(error) => {
reply(handleESError(error));
}
);
}
});
}

0 comments on commit e06e659

Please sign in to comment.