网站首页 网站源码
using System;
using Hangfire.Common;
using Hangfire.States;
using Hangfire.Storage;
namespace Dpz.Core.Web.Library.Activator
{
public class ProlongExpirationTimeAttribute : JobFilterAttribute, IApplyStateFilter
{
public void OnStateApplied(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
context.JobExpirationTimeout = TimeSpan.FromDays(30);
}
public void OnStateUnapplied(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
}
}
}