1

I'm using ABP framework (version 5.3.3) for my project. I have 2 tenants with separate databases on different servers. My project has a task needs to run every 5 minutes to call a stored procedure in database of each tenant but I don't know how to run that task with background worker simultaneously for those tenants? I know that Hangfire can process multiple queues but how to configure to achieve my purpose?

Hope that my question is clear and appreciate for your helps.

duyan
  • 63
  • 1
  • 8

1 Answers1

0

Your scheduled task should be :

  • loop over your list of tenants
  • foreach tenant, enqueue a background task which will run your stored procedure for this tenant

As far as I know (I don't know ABP), you don't need anything else to achieve your goal

jbl
  • 15,179
  • 3
  • 34
  • 101
  • Thanks for your solution. I knew that. But as I said above, my tenants are on different servers. I don't know how to change connection string when executing the task. – duyan Sep 28 '22 at 09:51
  • 1
    @duyan this may help https://stackoverflow.com/a/66659597/1236044 – jbl Sep 28 '22 at 11:40