Skip to content

Commit 44abf9f

Browse files
committed
Merge pull request HangfireIO#469 from mkravchuk7/master
Prevent infinite loops when trying to change state of a job that doesn't exist
2 parents 299e272 + bf42f5f commit 44abf9f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Hangfire.Core/States/BackgroundJobStateChanger.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ private static JobData GetJobData(StateChangeContext context)
132132
return jobData;
133133
}
134134

135-
if (context.CancellationToken.IsCancellationRequested)
135+
if (context.CancellationToken.IsCancellationRequested ||
136+
context.CancellationToken == CancellationToken.None)
136137
{
137138
return null;
138139
}

0 commit comments

Comments
 (0)