Skip to content

Commit

Permalink
Fixing type check
Browse files Browse the repository at this point in the history
  • Loading branch information
doakalexi committed Oct 31, 2024
1 parent 296872c commit 8d7df4c
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ export class ActionScheduler<
IActionScheduler<State, Context, ActionGroupIds, RecoveryActionGroupId>
> = [];

private ephemeralActionsToSchedule: number;

constructor(
private readonly context: ActionSchedulerOptions<
Params,
Expand All @@ -65,7 +63,6 @@ export class ActionScheduler<
AlertData
>
) {
this.ephemeralActionsToSchedule = context.taskRunnerContext.maxEphemeralActionsPerRule;
for (const [_, scheduler] of Object.entries(schedulers)) {
this.schedulers.push(new scheduler(context));
}
Expand Down Expand Up @@ -183,11 +180,7 @@ export class ActionScheduler<
enqueueOptions: EnqueueExecutionOptions;
bulkScheduleRequest: EnqueueExecutionOptions[];
}) {
if (
this.context.taskRunnerContext.supportsEphemeralTasks &&
this.ephemeralActionsToSchedule > 0
) {
this.ephemeralActionsToSchedule--;
if (this.context.taskRunnerContext.supportsEphemeralTasks) {
try {
await this.context.actionsClient!.ephemeralEnqueuedExecution(enqueueOptions);
} catch (err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ const taskRunnerFactoryInitializerParams: TaskRunnerFactoryInitializerParamsType
kibanaBaseUrl: 'https://localhost:5601',
logger,
maxAlerts: 1000,
maxEphemeralActionsPerRule: 10,
ruleTypeRegistry,
rulesSettingsService,
savedObjects: savedObjectsService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ describe('Task Runner', () => {
logger,
maintenanceWindowsService,
maxAlerts: 1000,
maxEphemeralActionsPerRule: 10,
ruleTypeRegistry,
rulesSettingsService,
savedObjects: savedObjectsService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ describe('Task Runner', () => {
logger,
maintenanceWindowsService,
maxAlerts: 1000,
maxEphemeralActionsPerRule: 10,
ruleTypeRegistry,
rulesSettingsService,
savedObjects: savedObjectsService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ describe('Task Runner Cancel', () => {
logger,
maintenanceWindowsService,
maxAlerts: 1000,
maxEphemeralActionsPerRule: 10,
ruleTypeRegistry,
rulesSettingsService,
savedObjects: savedObjectsService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ describe('Task Runner Factory', () => {
logger: loggingSystemMock.create().get(),
maintenanceWindowsService,
maxAlerts: 1000,
maxEphemeralActionsPerRule: 10,
ruleTypeRegistry: ruleTypeRegistryMock.create(),
rulesSettingsService,
savedObjects: savedObjectsService,
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/alerting/server/task_runner/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ export interface TaskRunnerContext {
logger: Logger;
maintenanceWindowsService: MaintenanceWindowsService;
maxAlerts: number;
maxEphemeralActionsPerRule: number;
ruleTypeRegistry: RuleTypeRegistry;
rulesSettingsService: RulesSettingsService;
savedObjects: SavedObjectsServiceStart;
Expand Down

0 comments on commit 8d7df4c

Please sign in to comment.