Skip to content

Commit

Permalink
Swallow errors during cancelSessionSearches
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Oct 29, 2023
1 parent 0a13dbe commit 7835584
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugins/data/server/search/search_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,16 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> {
private cancelSessionSearches = async (deps: SearchStrategyDependencies, sessionId: string) => {
const searchIdMapping = await deps.searchSessionsClient.getSearchIdMapping(sessionId);
await Promise.allSettled(
Array.from(searchIdMapping).map(([searchId, strategyName]) => {
Array.from(searchIdMapping).map(async ([searchId, strategyName]) => {
const searchOptions = {
sessionId,
strategy: strategyName,
isStored: true,
};

return this.cancel(deps, searchId, searchOptions);
return this.cancel(deps, searchId, searchOptions).catch(() => {
// Some strategies don't support cancellation - swallow these errors
});
})
);
};
Expand Down

0 comments on commit 7835584

Please sign in to comment.