Skip to content

Commit

Permalink
implement more selective logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Dec 18, 2024
1 parent a2e7edd commit 697be7d
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,20 +309,17 @@ export const reindexServiceFactory = (
}

try {
// Delete the task from ES .tasks index
const deleteTaskResp = await esClient.delete({
// Best effort, delete the task from ES .tasks index...
await esClient.delete({
index: '.tasks',
id: taskId,
});
if (deleteTaskResp.result !== 'deleted') {
log.warn(
error.reindexTaskCannotBeDeleted(
`Could not delete reindexing task ${taskId}, got response "${deleteTaskResp.result}"`
)
);
}
} catch (e) {
log.warn(e);
// We explicitly ignore authz related error codes bc we expect this to be
// very common when deleting from .tasks
if (e?.statusCode !== 401 && e?.statusCode !== 403) {
log.warn(e);
}
}

return reindexOp;
Expand Down

0 comments on commit 697be7d

Please sign in to comment.