# Hangfire with UsePostgreSqlStorage settings and concurrency

**URL:** <https://discuss.hangfire.io/t/hangfire-with-usepostgresqlstorage-settings-and-concurrency/9987>\
**Category:** question\
**Tags:** postgres\
**Created:** [May 28, 2023, 6:40pm UTC](https://discuss.hangfire.io/t/hangfire-with-usepostgresqlstorage-settings-and-concurrency/9987 "2023-05-28T18:40:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohmohmoh](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/mohmohmoh/32/3303_2.png) [@mohmohmoh](https://discuss.hangfire.io/u/mohmohmoh)\
**Post date:** [May 28, 2023, 6:40pm UTC](https://discuss.hangfire.io/t/hangfire-with-usepostgresqlstorage-settings-and-concurrency/9987/1 "2023-05-28T18:40:58Z")

</div>

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”)

```auto
<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
