.ServerName is deprecated

I just upgraded to 1.5 and noticed that the ServerName property of BackgroundJobServerOptions is deprecated. I was using this property to specify the machine that I want the Hangfire servers to run on. Before that we would get production jobs running on server instances on our development and test machines (not good).

How can I specify the machine that I want Hangfire server instances created on?

A bit late reply, but for posterity’s sake:

I’ve solved this by making a machine-specific queue, like:

This can be initiated somehwat like this.

var options = new BackgroundJobServerOptions
{
    Queues = new[] { System.Environment.MachineName }
};
   			
new BackgroundJobServer(options, ... );

You can assign your job to run at a specifc queue using HangFires’ new EnqueuedState([QUEUENAMEHERE])