Skip to content

Commit

Permalink
Merge pull request elastic#3 from XavierM/pr/127081
Browse files Browse the repository at this point in the history
mike feedback for X
  • Loading branch information
Zacqary authored Mar 17, 2022
2 parents 70e9f13 + 94873eb commit 60117fe
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions x-pack/plugins/alerting/server/rules_client/rules_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,12 @@ export class RulesClient {
id: string;
snoozeEndTime: string | -1;
}): Promise<void> {
if (typeof snoozeEndTime === 'string') {
const snoozeDateValidationMsg = validateSnoozeDate(snoozeEndTime);
if (snoozeDateValidationMsg) {
throw new RuleMutedError(snoozeDateValidationMsg);
}
}
return await retryIfConflicts(
this.logger,
`rulesClient.snooze('${id}', ${snoozeEndTime})`,
Expand All @@ -1501,13 +1507,6 @@ export class RulesClient {
}

private async snoozeWithOCC({ id, snoozeEndTime }: { id: string; snoozeEndTime: string | -1 }) {
if (typeof snoozeEndTime === 'string') {
const snoozeDateValidationMsg = validateSnoozeDate(snoozeEndTime);
if (snoozeDateValidationMsg) {
throw new RuleMutedError(snoozeDateValidationMsg);
}
}

const { attributes, version } = await this.unsecuredSavedObjectsClient.get<RawRule>(
'alert',
id
Expand Down

0 comments on commit 60117fe

Please sign in to comment.