I have two servers behind one load balancer.
I published a new version of my web application to one specific server. This new server has the following code:
app.UseHangfire(config =>
{
config.UseSqlServerStorage("foo");
config.UseServer("bar", "default");
});
The new server has this function too:
[Queue("bar")]
[AutomaticRetry(Attempts = 3)]
public static void ProcessFile(string path)
{
...
}
I understand that the new server is the one in charge of processing jobs of the bar queue because the old server doesn’t have the config.UseServer("bar", "default");
line.
The old server calls that function with one argument: config.UseServer("default");
.
But for some reason, the old server is trying to process the jobs of the bar queue and an exception is thrown because that server doesn’t have the ProcessFile
function.
Any idea about what I am doing wrong?
Thanks!