I set up HangFire(version 1.7.25) on a .NET5 WebAPI with a connection string to a Postgres DB and it works fine on production. I then migrated my application to a new server(still .NET 5) with the same old connection string and it works fine too. Recently I changed the connection string(in appsettings.json) to a new database I created(which works fine for my normal database operations) but I noticed HangFire still uses the old Connection string as its host and all services are enqueued on it without running but, whenever I run the project on my local machine it takes all the enqueued jobs from the old DB instance and runs them locally.
So, does HangFire cache DB credentials somewhere or how do I update the connection string on the new server?
Turns out that during the first migration to the new server, the credentials from the old server were stored by HangFire, and even updating them in the connection string didn't help. I had to redeploy it to the server with the updated credentials and everything works fine now.