How can I configure hangfire to excute only a instance?

recurring
Tags: #<Tag:0x00007f499ac67470>

#1

Hi,

I’m having problem with hangfire when I use recurringjob. My app has many jobs and sometimes a instance starts a job, same time that another instance still executing. I use InstancePerLifetimeScope, but when I use InstancePerBackgroundJob, hangfire throws a expection “Autofac.Core.DependencyResolutionException”. How can I solve this problem?

Regards


#2

I’m using these attributes and from what I can tell I only have one instance running at a time now.

[DisableConcurrentExecution(10)]
[AutomaticRetry(Attempts = 0, LogEvents = false, OnAttemptsExceeded = AttemptsExceededAction.Delete)]

#3

Hi,

thank you for your advice. It works for me.