feat: initial commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using Hangfire.Common;
|
||||
using Hangfire.States;
|
||||
|
||||
namespace Strata.Stratasphere.Biz.Configuration.Hangfire
|
||||
{
|
||||
public class DeleteOnSuccessAttribute : JobFilterAttribute, IElectStateFilter
|
||||
{
|
||||
public void OnStateElection(ElectStateContext context)
|
||||
{
|
||||
if (context.CandidateState.Name == SucceededState.StateName)
|
||||
{
|
||||
context.CandidateState = new DeletedState { Reason = "This job is deleted on success." };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user