Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ export const ConfigValidator: FC<ConfigValidatorProps> = React.memo(
({ jobConfigs = [], alertInterval, alertParams, alertNotifyWhen, maxNumberOfBuckets }) => {
if (jobConfigs.length === 0) return null;

const alertIntervalInSeconds = parseInterval(alertInterval)!.asSeconds();
const alertIntervalInSeconds = parseInterval(alertInterval)?.asSeconds();

const lookbackIntervalInSeconds =
!!alertParams.lookbackInterval && parseInterval(alertParams.lookbackInterval)?.asSeconds();

const isAlertIntervalTooHigh =
lookbackIntervalInSeconds && lookbackIntervalInSeconds < alertIntervalInSeconds;
lookbackIntervalInSeconds &&
alertIntervalInSeconds &&
lookbackIntervalInSeconds < alertIntervalInSeconds;

const jobWithoutStartedDatafeed = jobConfigs
.filter((job) => job.datafeed_config.state !== DATAFEED_STATE.STARTED)
Expand All @@ -49,6 +51,7 @@ export const ConfigValidator: FC<ConfigValidatorProps> = React.memo(
const notifyWhenWarning =
alertNotifyWhen === 'onActiveAlert' &&
lookbackIntervalInSeconds &&
alertIntervalInSeconds &&
alertIntervalInSeconds < lookbackIntervalInSeconds;

const bucketSpanDuration = parseInterval(jobConfigs[0].analysis_config.bucket_span!);
Expand Down