Skip to content

Commit

Permalink
Don't refresh after SO updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dgieselaar committed May 3, 2021
1 parent 9b6bb25 commit 54f848d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/server/actions_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ export class ActionsClient {
})
);

return await this.unsecuredSavedObjectsClient.delete('action', id);
return await this.unsecuredSavedObjectsClient.delete('action', id, { refresh: false });
}

public async execute({
Expand Down
5 changes: 4 additions & 1 deletion x-pack/plugins/actions/server/create_execute_function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ export function createExecutionEnqueuerFunction({
params,
apiKey,
},
executionSourceAsSavedObjectReferences(source)
{
...executionSourceAsSavedObjectReferences(source),
refresh: false,
}
);

await taskManager.schedule({
Expand Down
7 changes: 3 additions & 4 deletions x-pack/plugins/actions/server/lib/task_runner_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,9 @@ export class TaskRunnerFactory {
// We would idealy secure every operation but in order to support clean up of legacy alerts
// we allow this operation in an unsecured manner
// Once support for legacy alert RBAC is dropped, this can be secured
await getUnsecuredSavedObjectsClient(fakeRequest).delete(
ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE,
actionTaskParamsId
);
await getUnsecuredSavedObjectsClient(
fakeRequest
).delete(ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE, actionTaskParamsId, { refresh: false });
} catch (e) {
// Log error only, we shouldn't fail the task because of an error here (if ever there's retry logic)
logger.error(
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/task_manager/server/task_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class TaskStore {
*/
public async remove(id: string): Promise<void> {
try {
await this.savedObjectsRepository.delete('task', id);
await this.savedObjectsRepository.delete('task', id, { refresh: false });
} catch (e) {
this.errors$.next(e);
throw e;
Expand Down

0 comments on commit 54f848d

Please sign in to comment.