Skip to content

Commit

Permalink
try catch around close pit
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaElastic committed Jun 24, 2022
1 parent b154c3e commit 7f9bc3b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion x-pack/plugins/fleet/server/services/agents/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,13 @@ export async function openAgentsPointInTime(esClient: ElasticsearchClient): Prom
}

export async function closeAgentsPointInTime(esClient: ElasticsearchClient, pitId: string) {
await esClient.closePointInTime({ id: pitId });
try {
await esClient.closePointInTime({ id: pitId });
} catch (error) {
appContextService
.getLogger()
.warn(`Error closing point in time with id: ${pitId}. Error: ${error.message}`);
}
}

export async function getAgentsByKuery(
Expand Down

0 comments on commit 7f9bc3b

Please sign in to comment.