You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
640 B
22 lines
640 B
using LINGYUN.Abp.BackgroundTasks;
|
|
using LINGYUN.Abp.Notifications;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace LY.MicroService.RealtimeMessage.BackgroundJobs;
|
|
|
|
public class NotificationCleanupJob : IJobRunnable
|
|
{
|
|
/// <summary>
|
|
/// 每次清除记录大小
|
|
/// </summary>
|
|
public const string PropertyBatchCount = "BatchCount";
|
|
|
|
|
|
public async virtual Task ExecuteAsync(JobRunnableContext context)
|
|
{
|
|
var count = context.GetJobData<int>(PropertyBatchCount);
|
|
var store = context.GetRequiredService<INotificationStore>();
|
|
|
|
await store.DeleteNotificationAsync(count);
|
|
}
|
|
}
|
|
|