Skip to content

Commit

Permalink
Removed scheduled check
Browse files Browse the repository at this point in the history
  • Loading branch information
igoristic committed Oct 2, 2020
1 parent 635dfd0 commit 5d28f00
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ describe('CpuUsageAlert', () => {
};
const kibanaUrl = 'http://localhost:5601';

const hasScheduledActions = jest.fn();
const replaceState = jest.fn();
const scheduleActions = jest.fn();
const getState = jest.fn();
Expand All @@ -87,7 +86,6 @@ describe('CpuUsageAlert', () => {
callCluster: jest.fn(),
alertInstanceFactory: jest.fn().mockImplementation(() => {
return {
hasScheduledActions,
replaceState,
scheduleActions,
getState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ describe('DiskUsageAlert', () => {
};
const kibanaUrl = 'http://localhost:5601';

const hasScheduledActions = jest.fn();
const replaceState = jest.fn();
const scheduleActions = jest.fn();
const getState = jest.fn();
Expand All @@ -98,7 +97,6 @@ describe('DiskUsageAlert', () => {
callCluster: jest.fn(),
alertInstanceFactory: jest.fn().mockImplementation(() => {
return {
hasScheduledActions,
replaceState,
scheduleActions,
getState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export class DiskUsageAlert extends BaseAlert {

const alertInstanceState = { alertStates: newAlertStates };
instance.replaceState(alertInstanceState);
if (newAlertStates.length && !instance.hasScheduledActions()) {
if (newAlertStates.length) {
this.executeActions(instance, alertInstanceState, null, cluster);
state.lastExecutedAction = currentUTC;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export class MemoryUsageAlert extends BaseAlert {

const alertInstanceState = { alertStates: newAlertStates };
instance.replaceState(alertInstanceState);
if (newAlertStates.length && !instance.hasScheduledActions()) {
if (newAlertStates.length) {
this.executeActions(instance, alertInstanceState, null, cluster);
state.lastExecutedAction = currentUTC;
}
Expand Down

0 comments on commit 5d28f00

Please sign in to comment.