How to get Job context for recurring job?

Viewed 9

I am using below code to create recurring job. I need get the job context to update progress bar. Is there any way to do that?

@Job(name = "xxx")
@Recurring(id = "xxx")
public void execute(){
//do thing here.
}
1 Answers

You can just create your recurring job as follows:

@Job(name = "xxx")
@Recurring(id = "xxx")
public void execute(JobContext jobContext){
//do thing here.
}

It will automatically be injected by JobRunr.

Related