Multiple reoccurring Jobs with different args?

I am trying to use the below code, multiple times, with different parameters, to setup several slightly different instances of the same reoccurring task:

 `  public void ScheduleAutomaticPrinterProcess(Process process, Printer printer, Report report)
    RecurringJob.AddOrUpdate(() => AutoDailyPrinterCheck(process, printer, report), recurrenceCron,TimeZoneInfo.Local);

I am only getting one reoccurring task (i’m guessing that this is because the task is being added once and then updated each time i try to add a new task?) how can i add multiple reoccurring tasks, similar to the above fashion?

Am i missing something obvious here?

Recurring task identifier is generated from class/method name if not specified explicitly. And since you’re using the same method, task identifiers would be the same too.

Just use the AddOrUpdate overload with task identifier argument, and specify different identifiers for each invocation.

1 Like

Thanks pieceofsummer!

silly me, don’t how i missed that one…