From 3b41ff44355c4965aeebc0d406bcf0e96d8e825b Mon Sep 17 00:00:00 2001 From: Ersin Erdal Date: Tue, 9 Aug 2022 14:42:32 +0200 Subject: [PATCH] add lastTriggerDate --- x-pack/plugins/alerting/server/task_runner/task_runner.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.ts index e3d780a2254b7..91311e7517491 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -921,14 +921,14 @@ export class TaskRunner< ruleRunMetricsStore.incrementNumberOfTriggeredActions(); ruleRunMetricsStore.incrementNumberOfTriggeredActionsByConnectorType(action.actionTypeId); - actionsToTrigger.push(action); + actionsToTrigger.push({ ...action, lastTriggerDate: new Date().toISOString() }); } await Promise.all( actionsToTrigger.map(async (action) => { const enqueueOptions = { id: action.id, - params: { ...action.params, lastTriggerDate: new Date().toISOString() }, + params: action.params, spaceId, apiKey: apiKey ?? null, consumer: this.ruleConsumer!,