Skip to content

Commit

Permalink
Tweak fetch data back to original (opensearch-project#2238)
Browse files Browse the repository at this point in the history
Signed-off-by: Kristen Tian <tyarong@amazon.com>

Signed-off-by: Kristen Tian <tyarong@amazon.com>
  • Loading branch information
kristenTian committed Sep 14, 2022
1 parent dbda07d commit a246e42
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 a246e42

Please sign in to comment.