这是基于vue-vben-admin 模板适用于abp Vnext的前端管理项目
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.
 
 
 
 
 
 

38 lines
1.3 KiB

using LINGYUN.Abp.Notifications;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.MessageService.BackgroundJobs
{
internal class NotificationCleanupExpritionJob : AsyncBackgroundJob<NotificationCleanupExpritionJobArgs>, ITransientDependency
{
protected INotificationStore Store { get; }
protected IServiceProvider ServiceProvider { get; }
public NotificationCleanupExpritionJob(
INotificationStore store,
IServiceProvider serviceProvider)
{
Store = store;
ServiceProvider = serviceProvider;
}
public override async Task ExecuteAsync(NotificationCleanupExpritionJobArgs args)
{
try
{
Logger.LogDebug("Before cleanup exprition jobs...");
await Store.DeleteNotificationAsync(args.Count);
Logger.LogDebug("Exprition jobs cleanup job was successful...");
}
catch (Exception ex)
{
Logger.LogWarning("Exprition jobs cleanup job was failed...");
Logger.LogWarning("Error:{0}", ex.Message);
}
}
}
}