Skip to content

Commit

Permalink
Tweak fetch data back to original (#2238)
Browse files Browse the repository at this point in the history
Signed-off-by: Kristen Tian <[email protected]>

Signed-off-by: Kristen Tian <[email protected]>
  • Loading branch information
kristenTian authored Aug 31, 2022
1 parent ea844b9 commit ab9aa8d
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class CreateIndexPatternWizard extends Component<
);

// query local and remote indices, updating state independently
const queryLocalAndRemotePromise = ensureMinimumTime(
ensureMinimumTime(
this.catchAndWarn(
getIndices({ http, getIndexTags, pattern: '*', searchClient, dataSourceId }),

Expand All @@ -175,7 +175,7 @@ export class CreateIndexPatternWizard extends Component<
this.setState({ allIndices, isInitiallyLoadingIndices: false })
);

const queryWithFallbackPromise = this.catchAndWarn(
this.catchAndWarn(
// if we get an error from remote cluster query, supply fallback value that allows user entry.
// ['a'] is fallback value
getIndices({ http, getIndexTags, pattern: '*:*', searchClient, dataSourceId }),
Expand All @@ -185,8 +185,6 @@ export class CreateIndexPatternWizard extends Component<
).then((remoteIndices: string[] | MatchedItem[]) =>
this.setState({ remoteClustersExist: !!remoteIndices.length })
);

await Promise.all([queryLocalAndRemotePromise, queryWithFallbackPromise]);
};

createIndexPattern = async (timeFieldName: string | undefined, indexPatternId: string) => {
Expand Down Expand Up @@ -244,7 +242,7 @@ export class CreateIndexPatternWizard extends Component<

goToNextFromDataSource = (dataSourceRef: DataSourceRef) => {
this.setState({ isInitiallyLoadingIndices: true, dataSourceRef }, async () => {
await this.fetchData();
this.fetchData();
this.goToNextStep();
});
};
Expand Down

0 comments on commit ab9aa8d

Please sign in to comment.