HangfireIO / HangfireIO/Hangfire

RecurringJob Are Always Pending

Open
#1,502 1 comment 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

I'm using Hangfire to run a few Recurring Jobs that needs to be executed every period of time.

Registration:
``` C#
RecurringJob.AddOrUpdate(
job => job.Execute(null), // async method
"NCRON expression");
```

Configuraitons :
``` C#
GlobalConfiguration.Configuration
.UseSqlServerStorage(hangFireConfig.StorageConnection)
.UseTagsWithSql()
.UseConsole(new ConsoleOptions
{
BackgroundColor = "#9E9E9E",
ExpireIn = TimeSpan.FromHours(8),
PollInterval = 1000,
TextColor = "#212121",
TimestampColor = "#3F51B5"
});

// filters
GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute
{
Attempts = 0,
OnAttemptsExceeded = AttemptsExceededAction.Fail
});
```

The Issue I'm facing is once the job is finished they always are in a pending state which stop the next execution no matter if an exception was thrown or not.

I tried to set manually the state with a IElectStateFilter setting `CandidateState` however it is not working...

Is there something I missing ?

Thanks a lot

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.