fix:修复预警通知查询改为全量查询,以保证正确的预警数量

This commit is contained in:
hardstylewyl 2025-03-27 11:57:46 +08:00
parent bf3afe9480
commit 21e6d444a7

View File

@ -45,12 +45,12 @@ public sealed class WarningNotifyAggregator : ITransientDependency
// 4.绑定这个任务id(可能是多个)和jobId用户跟踪任务状态
public async Task<(List<NotifyConfig> NotifyConfigs, HashSet<int> taskIds)> ScanNotifyAndAggregateAsync()
{
// 构建查询游标
var options = _optionsMonitor.CurrentValue;
var cursor = DateTime.Now.Subtract(TimeSpan.FromHours(options.ScanWarningNotifyTaskHourInterval));
// 构建查询游标 todo:全量查询需要优化
// var options = _optionsMonitor.CurrentValue;
// var cursor = DateTime.Now.Subtract(TimeSpan.FromHours(options.ScanWarningNotifyTaskHourInterval));
// 1.扫描出可能进行的任务
var tasks = await _warningTaskRepository.ScanNotifyTaskAsync(cursor);
var tasks = await _warningTaskRepository.ScanNotifyTaskAsync();
// 2.可行性过滤
var filtered = await FilterAsync(tasks);