mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Add a refresh:false when deleting action_task_params (#144399)
* Add a refresh:false when deleting action_task_params * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
c795facbe9
commit
2c909c18cd
2 changed files with 8 additions and 3 deletions
|
@ -304,7 +304,9 @@ test('cleans up action_task_params object', async () => {
|
|||
|
||||
await taskRunner.run();
|
||||
|
||||
expect(services.savedObjectsClient.delete).toHaveBeenCalledWith('action_task_params', '3');
|
||||
expect(services.savedObjectsClient.delete).toHaveBeenCalledWith('action_task_params', '3', {
|
||||
refresh: false,
|
||||
});
|
||||
});
|
||||
|
||||
test('task runner should implement CancellableTask cancel method with logging warning message', async () => {
|
||||
|
@ -367,7 +369,9 @@ test('runs successfully when cleanup fails and logs the error', async () => {
|
|||
|
||||
await taskRunner.run();
|
||||
|
||||
expect(services.savedObjectsClient.delete).toHaveBeenCalledWith('action_task_params', '3');
|
||||
expect(services.savedObjectsClient.delete).toHaveBeenCalledWith('action_task_params', '3', {
|
||||
refresh: false,
|
||||
});
|
||||
expect(taskRunnerFactoryInitializerParams.logger.error).toHaveBeenCalledWith(
|
||||
'Failed to cleanup action_task_params object [id="3"]: Fail'
|
||||
);
|
||||
|
|
|
@ -171,7 +171,8 @@ export class TaskRunnerFactory {
|
|||
// Once support for legacy alert RBAC is dropped, this can be secured
|
||||
await getUnsecuredSavedObjectsClient(request).delete(
|
||||
ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE,
|
||||
actionTaskExecutorParams.actionTaskParamsId
|
||||
actionTaskExecutorParams.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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue