Skip to content

Commit

Permalink
Add runtime license check for suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallmain committed Nov 10, 2022
1 parent 66fda9d commit d757582
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ export const queryExecutor = async ({
exceptionFilter: runOpts.exceptionFilter,
});

const license = await firstValueFrom(licensing.license$);
const hasPlatinumLicense = license.hasAtLeast('platinum');
const hasGoldLicense = license.hasAtLeast('gold');

const result =
ruleParams.alertSuppression?.groupBy != null
ruleParams.alertSuppression?.groupBy != null && hasPlatinumLicense
? await groupAndBulkCreate({
runOpts,
services,
Expand Down Expand Up @@ -94,9 +98,6 @@ export const queryExecutor = async ({
state: {},
};

const license = await firstValueFrom(licensing.license$);
const hasGoldLicense = license.hasAtLeast('gold');

if (hasGoldLicense) {
if (completeRule.ruleParams.responseActions?.length && result.createdSignalsCount) {
scheduleNotificationResponseActions(
Expand Down

0 comments on commit d757582

Please sign in to comment.