Hangfire Discussion

Can we have tasks that can be run on all servers?

sql-server
Tags: #<Tag:0x00007f84fb641f68>

#1

Hi,
I user Hangfire in WebFarm model. Is there any way to asks hagfire to run the specific task on all servers? Indeed this task update some “static properties”. So I need a mechanism to update this properties when they have been changed in database. As I know, hangfire just runs the specific task only on server.


#2

I’m also interested, we have a cleanup task to purge old “sessions” on our servers. This becomes problematic in a clustered scenario where the task basically cleans up servers randomly. Not a big issue, but we don’t want things left up to chance.

The only solution that we came up with is to have a dedicated queue for each server and queue tasks for each server via that queue.


#3

I am looking for the same thing. Have you got this working?


#4

Would you please give us more details? How do you create a dedicated queue and how do you make it recurring?


#5

As one of Hangfire developers mentioned here , this future is not available in Hangfire till now. He offers using System.Threading.Timer..
But there is some work-around too : check this