Browse Source

fix(notifications): fixed expired expired notices jobs

pull/1276/head
colin 8 months ago
parent
commit
c49db6a203
  1. 6
      aspnet-core/modules/task-management/LINGYUN.Abp.Notifications.Jobs/LINGYUN/Abp/Notifications/Jobs/NotificationCleanupJob.cs

6
aspnet-core/modules/task-management/LINGYUN.Abp.Notifications.Jobs/LINGYUN/Abp/Notifications/Jobs/NotificationCleanupJob.cs

@ -1,6 +1,8 @@
using LINGYUN.Abp.BackgroundTasks;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Timing;
namespace LINGYUN.Abp.Notifications.Jobs;
@ -24,8 +26,10 @@ public class NotificationCleanupJob : IJobRunnable
public async virtual Task ExecuteAsync(JobRunnableContext context)
{
var count = context.GetJobData<int>(PropertyBatchCount);
var clock = context.GetRequiredService<IClock>();
var store = context.GetRequiredService<INotificationStore>();
var currentTenant = context.GetRequiredService<ICurrentTenant>();
await store.DeleteNotificationAsync(count);
await store.DeleteExpritionNotificationAsync(currentTenant.Id, count, clock.Now);
}
}

Loading…
Cancel
Save