Skip to content

Commit

Permalink
♻ refactor: Alarm notification add checkTime variables
Browse files Browse the repository at this point in the history
  • Loading branch information
wzh425 committed Sep 5, 2024
1 parent 00ee86c commit 75213d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ private async Task AddLogVariablesAsync(AlarmRule alarmRule, Dictionary<string,
if (startTime == null)
return;

variables.TryAdd(AlertConsts.CHECK_START_TIME_NOTIFICATION_TEMPLATE_VAR_NAME, startTime.Value.UtcDateTime);
variables.TryAdd(AlertConsts.CHECK_END_TIME_NOTIFICATION_TEMPLATE_VAR_NAME, checkTime.UtcDateTime);

var request = new LogLatestRequest
{
Query = alarmRule.WhereExpression,
Expand Down
2 changes: 2 additions & 0 deletions src/Domain/Masa.Alert.Domain.Shared/Consts/AlertConsts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ public static class AlertConsts
public const string DB_TABLE_PREFIX = null;
public const string DB_SCHEMA = "alert";
public const string ALARM_RULE_NAME_NOTIFICATION_TEMPLATE_VAR_NAME = "Name";
public const string CHECK_START_TIME_NOTIFICATION_TEMPLATE_VAR_NAME = "CheckStartTime";
public const string CHECK_END_TIME_NOTIFICATION_TEMPLATE_VAR_NAME = "CheckEndTime";
}

0 comments on commit 75213d6

Please sign in to comment.