Skip to content

Commit

Permalink
Merge pull request #8674 from elastic/jasper/backport/8505/5.0
Browse files Browse the repository at this point in the history
[backport] PR #8505 to 5.0 - [ingest/register_fields_capabilities] prevent calling reply() twice
  • Loading branch information
spalger authored Oct 13, 2016
2 parents 0b519aa + da19bc1 commit 44d2a4c
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 44d2a4c

Please sign in to comment.