I am using the below packages for my project and have some problems with settings and concurrency.
I am using InvisibilityTimeout = TimeSpan.MaxValue
as I have really long tasks eg. 50 hours. as far as I know PostgreSqlStorage
does not support SlidingTimeout and not sure how to use it.
First question: Is there a way to extend running jobs invisibility timeout using/updating PerformContext context
data?
Another issue I am having is concurrency as I have long-running jobs this is not working as I wanted. Currently, I am using [DisableConcurrentExecution(timeoutInSeconds: 10 * 60)]
but this is not working how I expected. If there is a running task Hangfire keeps adding them to Q and after the timeout, it started running the second one even though there is already a running job.
Is there a way to not add the same task completely? Otherwise, I am planning to implement a HashTable check as currently one server or a simple table select with EF Core. Is there a way in Hangfire to do that for a running job? eg context.IsRunning(“jobName”)
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.0" />
<PackageReference Include="Hangfire.Console" Version="1.4.2" />
<PackageReference Include="Hangfire.Core" Version="1.8.0" />
<PackageReference Include="Hangfire.PostgreSql" Version="1.19.12" />
Thanks