Is there a way to get specific jobID and job method of schedule Job?


#1

I have found Jobstorage.Current.GetMonitoringAPI().ScheduleJobs(0,2000) but it only return me with the latest job and in a very ugly form. I only want it to show me ID or method. Is there away to do that?


#2

What are you actually trying to accomplish?

When you schedule the Job you can specify an Id (“some-id” in the below code)
var manager = new RecurringJobManager(); manager.AddOrUpdate("some-id", Job.FromExpression(() =>; Method()), Cron.Yearly());

https://docs.hangfire.io/en/latest/background-methods/performing-recurrent-tasks.html

You can delete/trigger/update the Scheduled Job with that id.


#3

I was trying to figure out a way to edit time span of a schedule job and time span only. Like by query to an id, I will get schedule job method and stuff. The closets thing I have found is to recreate whole new thing. So I ended up faking Schedule Job by running a Recurring Job then remove it after first time generated. That way I can edit it’s time span however I want.


#4

I’m still not 100% sure what you were trying to do but glad you found a solution.