Getting the RecurringJobId from a JobId in FilterAttribute

recurring
Tags: #<Tag:0x00007f281979d9f0>

#1

Hi,

Is there a way to get the RecurringJobId from a JobId within a FilterAttribute

Example

RecurringJob.AddOrUpdate<DoThat>("MyJob", x => x.DoThis(), Cron.Minutely);

Within the FilterAttribute

public void OnPerforming(PerformingContext filterContext)
{
    var jobId = filterContext.JobId;
    // i would like here to get "MyJob" string value based on the jobId
    var recurringJobId = ??
}

How to check if BackgroundJob was created by RecurringJob, not launched from eg. Dashboard?
#2

What do you want to do with recurring job id here?


#3

I would like to get the recurring job id at this level so I can check if is paused.
Using the technique explained here Pause/disable recurring job


#4

Hi @Massanu
This thread is long dead, but did you managed to get the recurringJobId? I’ve got similar problem: How to check if BackgroundJob was created by RecurringJob, not launched from eg. Dashboard?