Hi, i’m trying to use hangfire in our multi-tenant application, which has 2 databases, but sharing the same application code.
My goal is, depending on the URL (tenant1 ot tenant2), i need to create the job in the correct database. Tenant1 client goes to tenant1 DB, Tenant2 client goes to Tenant2 DB.
But it seems that after i have setup the connection string for the first time, i can’t change it for the subsequent time.
For example, this code :
Line2 BackgroundJob.Enqueue(JOB1) --> queue inserted to tenant1DB
Line4 BackgroundJob.Enqueue(JOB2) --> queue inserted to tenant2DB instead of tenant1DB, which is wrong
Is there a way to change the DB Connection string to be used properly?