Job was triggered but code execution never happened

recurring
aspnetcore
sql-server
Tags: #<Tag:0x00007f49a6e45ee8> #<Tag:0x00007f49a6e45d80> #<Tag:0x00007f49a6e45c40>

#1

Hi. On my production environment, I have two cron jobs, one will trigger daily and another one monthly.

The thing is for daily job, it was indeed triggered. But all steps in that method never executes. It seems rather weird particularly when monthly was working fine (triggered and method executed) but not for daily(triggered but no method executed). It becomes weirder when the daily job is working as intended when I manually run the job.

Below is how I implemented the code in my startup.cs:

RecurringJob.AddOrUpdate(e=> e.BillEmailsJob(), Cron.Monthly, TimeZoneInfo.Local);
RecurringJob.AddOrUpdate(f=> f.StorageRecord(), Cron.Daily, TimeZoneInfo.Local);

Is there anything that I overlooked?


#2

Bit of a needle and haystack situation but … one thing that pops to mind instantly is … What queue is each of the jobs assigned to (and also check that in the job detail screen of the dashboard to confirm it is actually what you expect it to be).

Reason why I say that is because requeueing a job (depending on your code) does have typically the side effect (unless you have coded something to specifically compensate for this) of changing the queue of said job to DEFAULT. Hence my suggestion of checking what queue the scheduled runs get sent to. And if there is a worker picking up jobs from that queue because if not then it will indeed never actually run.

Cheers,
Hans