From cb1970af0d90d137520729e8d5f73e4f2d1b1eea Mon Sep 17 00:00:00 2001 From: Ersin Erdal Date: Wed, 21 Dec 2022 00:58:23 +0100 Subject: [PATCH] Fix failing test --- x-pack/plugins/actions/server/actions_config.ts | 6 +++--- x-pack/plugins/actions/server/lib/task_runner_factory.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/actions/server/actions_config.ts b/x-pack/plugins/actions/server/actions_config.ts index 908d196ccbac50..43dd35ba38021c 100644 --- a/x-pack/plugins/actions/server/actions_config.ts +++ b/x-pack/plugins/actions/server/actions_config.ts @@ -209,9 +209,9 @@ export function getActionsConfigurationUtilities( ); return ( - connectorTypeConfig?.maxAttempts ?? - config.run?.maxAttempts ?? - actionTypeMaxAttempts ?? + connectorTypeConfig?.maxAttempts || + config.run?.maxAttempts || + actionTypeMaxAttempts || DEFAULT_MAX_ATTEMPTS ); }, diff --git a/x-pack/plugins/actions/server/lib/task_runner_factory.ts b/x-pack/plugins/actions/server/lib/task_runner_factory.ts index 2c23dbc77e3162..8ef48089db49db 100644 --- a/x-pack/plugins/actions/server/lib/task_runner_factory.ts +++ b/x-pack/plugins/actions/server/lib/task_runner_factory.ts @@ -105,7 +105,7 @@ export class TaskRunnerFactory { // Throwing an executor error means we will attempt to retry the task // TM will treat a task as a failure if `attempts >= maxAttempts` // so we need to handle that here to avoid TM persisting the failed task - const isRetryableBasedOnAttempts = taskInfo.attempts < (maxAttempts ?? 1); + const isRetryableBasedOnAttempts = taskInfo.attempts < maxAttempts; const willRetryMessage = `and will retry`; const willNotRetryMessage = `and will not retry`;