配置保存在独立数据库表 CourseGradeStatisticsRefreshSettings,不是修改 appsettings.json。 后台每 10 秒读取配置,仅到期扫描;成绩录入、导入、审批时不再立即创建统计任务。 扫描发现过期数据后,仍通过持久任务、Outbox 和 RabbitMQ 执行;Redis统计缓存由处理任务统一刷新。
15 lines
435 B
C#
15 lines
435 B
C#
using Jiaowu.Api.Domain.Common;
|
|
|
|
namespace Jiaowu.Api.Domain.Academic;
|
|
|
|
public sealed class CourseGradeStatisticsRefreshSetting : EntityBase
|
|
{
|
|
public const string DefaultKey = "default";
|
|
|
|
public string Key { get; set; } = DefaultKey;
|
|
public bool IsEnabled { get; set; } = true;
|
|
public int IntervalSeconds { get; set; } = 300;
|
|
public int BatchSize { get; set; } = 100;
|
|
public DateTime? LastRunAt { get; set; }
|
|
}
|