Comments (5)
Thanks again!!!
1 server, 3 workers
I will try your recommendation, assuming you said:
c.UseConnectionFactory(MyOwnConnFactory)
from hangfire.postgresql.
Using connection factory works!!!
Thank you!!!
from hangfire.postgresql.
Heya.
This is a blind-and-untested code which you might try, assuming you have set up the services according to Npgsql docs.
services.AddHangfire((provider, config) =>
config.UsePostgreSqlStorage(c =>
c.UseExistingNpgsqlConnection(provider.GetRequiredSerice<NpgsqlConnection>())));
from hangfire.postgresql.
Hi, thanks
Yes I am testing your solution, it works.
I used service key to distinguish between different sources:
services.AddHangfire((provider, config) =>
config.UsePostgreSqlStorage(c =>
c.UseExistingNpgsqlConnection(provider.GetRequiredKeyService<NpgsqlConnection>(DataBaseKeyEnum.Name))));
In this way I can access my connection!
What a notice is that now keep showings a lot of warnings: "Could not place a lock on the resource 'hangfire:lock:recurring-job:ResetCheckIn' : Lock timeout"
But I ran a job and works, It is normal?
from hangfire.postgresql.
Hmm, no, this is not normal. How many servers (and workers) do you have active at the same time?
I have to admit I never really used the UseExistingNpgsqlConnection
directly, but rather the UseConnectionFactory
. I suggest to use that to handle the connection creation instead of an explicit existing connection. Existing has different dispose mechanics which might be interfering.
The interface is pretty straight forward - inject NpgsqlDataSource
and just create the connection from your data source in the method. This way the connection will be created from the source and disposed internally as it's treated as Hangfire-created connection.
from hangfire.postgresql.
Related Issues (20)
- NpgsqlConnectionStringBuilder is not giving updated builder instance for new connection string value. HOT 6
- Unable to run the solution as is in .NET 8 HOT 2
- ExpirationManager issue removing million of jobs HOT 13
- Performance Issues with Postgress HOT 29
- Job supposed to be re-queued on worker shutdown but it never is HOT 38
- NpgsqlDataSource support HOT 3
- How to migrate obsolete PostgreSqlBootstrapperConfigurationExtensions usage HOT 2
- Error "unsupported Unicode escape sequence" after update HOT 1
- EnableHeavyMigrations missing from PostgreSqlStorageOptions HOT 1
- One jobId with two entries of same parameter name in db HOT 1
- Not operating: "Could not place a lock on the resource 'hangfire:locks:schedulepoller': Lock timeout" HOT 1
- 1.8 migration guide HOT 1
- Could not place a lock on the resource 'hangfire:lock:recurring-job:jobid': Lock timeout. HOT 2
- Processing order in Hangfire.PostgreSql? HOT 2
- Job count by state query performance HOT 4
- Implement the List-returning GetFirstByLowestScoreFromSet HOT 3
- Attempting to retrieve FetchedJobs crashes due to duplicates
- Exception when Using NpgsqlDataSource with ConnectionFactory HOT 4
- Loading 5000 Failed jobs when there's even more causes a Memory Leak HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hangfire.postgresql.