Queuing one job cancels another?

recurring
Tags: #<Tag:0x00007f6a00c85070>

#1

I have 7 recurring Hangfire jobs running in production. When I try to deploy an 8th, the 7th of the seven previous jobs disappears. When I try to redeploy the one that disappeared, the 8th one disappears instead. Every time I deploy one, it cancels the others. Is there a limit I’m not aware of? Thanks.


#2

Seven is a limitation of a free version (just kidding :slight_smile:)

Check if your recurring jobs use different identifiers for jobs. If you call AddOrUpdate with the same identifier, it will replace recurring job definition. If you’re not explicitly specifying recurring job identifier, it only takes class and method name into account when auto-generating one, so the same job method with different arguments will replace existing recurring job.


#3

Thank you for the prompt reply! That’s funny, I was wondering if indeed it was a freeware limit – glad it’s not :blush:

I am using identifiers as far as I know; one is called “WFFtp” and the other is called “SilkRoad”. That’s how I can tell when one disappears. They are likewise using different Queues. They are both using the same Hangfire SQL tables, though, and are deployed on the same server. Can you think of anything else that might cause that behavior?


#4

Please show how you’re adding those recurring jobs. And are you 100% sure you’re not accidentally calling RemoveIfExists at some point?


#5

Correct, I am only calling AddOrUpdate. Here’s the code from each Startup.cs file (using OWIN):

#1:

RecurringJob.AddOrUpdate<FtpJob>("WFFtp", x => x.DownloadFtpFiles(_jobConfig), _jobInterval);

#2:

RecurringJob.AddOrUpdate<SilkRoadJob>("SilkRoad", x => x.RunSilkRoadJob(_jobConfig), Cron.MinuteInterval(5));

Both are using their own HangfireBootstrapper class + ApplicationPreload setup in IIS to enable the always running component.


#6

So they’re scheduled by multiple IIS sites?

You’ve said you have 8 recurring jobs. That is two of them. What are the other 6?


#7

Correct, multiple sites in IIS–all on the same server.

The other 6 do not seem to be affected by this at all. They are likewise six separate sites in IIS. They’ve been operational for over a year, no issues. These last two jobs I’ve only added within the last two weeks.


#8

OMG I’m so sorry. Please close this ticket. I just realized those 6 jobs are running in two places – in test environment, and in production environment. Those two new jobs – one is test, and the other is production. THAT’S WHY THEY DON’T SHOW UP IN SAME DASHBOARD!! So sorry. Problem between chair and keyboard. :confounded:


#9

I love Hangfire by the way! Keep up the great work. So sorry to trouble you.