HangfireIO / HangfireIO/Hangfire

Cannot continuewith on a recurring job

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

Description

I'd like to continuewith after a recurring job succeeds.

```
RecurringJob.AddOrUpdate("id1", j => j.Run(), Cron.Monthly(1, 4, 5));
var continueJobId = BackgroundJob.ContinueWith("id1", j => j.Run());
```

But this throws a cannot parse number from string error. Then when the `id1` is a number instead I get:

```
SqlException: The MERGE statement conflicted with the FOREIGN KEY constraint "FK_HangFire_JobParameter_Job".
The conflict occurred in database "asdf", table "HangFire.Job", column 'Id'.
The statement has been terminated.
```

I believe that this should be acceptable functionality.

Having said that, at the very least there should be a more descriptive error stating that you cannot continueWith a recurring job.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the examples using RecurringJob.AddOrUpdate and BackgroundJob.ContinueWith, checking both the string and numeric job IDs. Trace how recurring-job IDs are handled and define done as either supported continuation behavior or a descriptive error explaining that recurring jobs cannot be continued.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.