Skip to content

Commit

Permalink
Adding await
Browse files Browse the repository at this point in the history
  • Loading branch information
ymao1 committed Jan 12, 2022
1 parent c180aac commit 265bc66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x-pack/plugins/event_log/server/es/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class EsInitializationSteps {
this.esContext.logger.error(`error getting existing index templates - ${err.message}`);
}

asyncForEach(Object.keys(indexTemplates), async (indexTemplateName: string) => {
await asyncForEach(Object.keys(indexTemplates), async (indexTemplateName: string) => {
try {
const hidden: string | boolean = indexTemplates[indexTemplateName]?.settings?.index?.hidden;
// Check to see if this index template is hidden
Expand Down Expand Up @@ -93,7 +93,7 @@ class EsInitializationSteps {
// should not block the rest of initialization, log the error and move on
this.esContext.logger.error(`error getting existing indices - ${err.message}`);
}
asyncForEach(Object.keys(indices), async (indexName: string) => {
await asyncForEach(Object.keys(indices), async (indexName: string) => {
try {
const hidden: string | boolean | undefined = indices[indexName]?.settings?.index?.hidden;

Expand Down Expand Up @@ -125,7 +125,7 @@ class EsInitializationSteps {
// should not block the rest of initialization, log the error and move on
this.esContext.logger.error(`error getting existing index aliases - ${err.message}`);
}
asyncForEach(Object.keys(indexAliases), async (indexName: string) => {
await asyncForEach(Object.keys(indexAliases), async (indexName: string) => {
try {
const aliases = indexAliases[indexName]?.aliases;
const hasNotHiddenAliases: boolean = Object.keys(aliases).some((alias: string) => {
Expand Down

0 comments on commit 265bc66

Please sign in to comment.