Browse Source
Merge pull request #1276 from colinin/remove-user-expired-notifications
fix(notifications): fixed expired expired notices jobs
pull/1284/head
yx lin
8 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
5 additions and
1 deletions
-
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); |
|
|
|
} |
|
|
|
} |
|
|
|
|