HangfireIO / HangfireIO/Hangfire

Setting context to DeletedState doesn't invoke OnStateElection

Open
#495 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

If a job's state context is explicitly set to DeletedState, then it's deleted but the OnStateElection filter event is not invoked with the new state.

``` csharp
public void OnStateElection(ElectStateContext context)
{
if (some_condition)
{
// this should invoke this filter event with the new state, but it doesn't
context.CandidateState = new DeletedState();
}
}
```

Is this by design or a bug?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.