Skip to content

Commit

Permalink
fixed due to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Oct 4, 2021
1 parent ae1bbff commit 9d30db7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ For example, `20m`, `24h`, `7d`, `1w`. Default: `60s`.
Sets the number of actions that will be executed ephemerally. To use this, enable ephemeral tasks in task manager first with <<task-manager-settings,`xpack.task_manager.ephemeral_tasks.enabled`>>

`xpack.alerting.defaultRuleTaskTimeout`::
Specifies the default framework timeout for the all rule types tasks. Task timeout could be overridden by the rule type producer during registration. The time is formatted as:
Specifies the default timeout for the all rule types tasks. Task timeout could be overridden by the rule type producer during registration. The time is formatted as:
+
`<count>[ms,s,m,h,d,w,M,Y]`
+
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const configSchema = schema.object({
maxEphemeralActionsPerAlert: schema.number({
defaultValue: DEFAULT_MAX_EPHEMERAL_ACTIONS_PER_ALERT,
}),
defaultRuleTaskTimeout: schema.string({ validate: validateDurationSchema, defaultValue: '10m' }),
defaultRuleTaskTimeout: schema.string({ validate: validateDurationSchema, defaultValue: '5m' }),
});

export type AlertsConfig = TypeOf<typeof configSchema>;
8 changes: 8 additions & 0 deletions x-pack/plugins/alerting/server/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ describe('Alerting Plugin', () => {
minimumLicenseRequired: 'basic',
});
});

it('should apply default config value for ruleTaskTimeout', async () => {
setup.registerType({
...sampleAlertType,
minimumLicenseRequired: 'basic',
});
expect(sampleAlertType.ruleTaskTimeout).toBe('5m');
});
});
});

Expand Down

0 comments on commit 9d30db7

Please sign in to comment.