on 01-10-2019 4:17 PM
Dear experts, et. al.,
We are using the cronJobService to perform a cronjob (cronJobService.performCronJob(cronJob)) in combination with a cluster environment. At some point, the cronJobService will schedule tasks using the taskService, which internally spawns a number of threads (e.g. 10).
When those threads have finished executing we need to check the status of the Cronjob and we are doing it in the following way:
if (cronJobService.isFinished(cronJob) && cronJobService.isSuccessful(cronJob))
{
...
}
However, it is possible that the scheduler would execute the portion of the code that checks if the cronjob has finished before all the generated tasks have finished execution. We basically need to find a way to wait until those tasks are done and then check the status of the Cronjob.
Any help would be greatly appreciated!
Regards,
L
Hi ,
Cron Job describes a single run of a Job default. It depends on the number of triggers you have added to trigger your cron job.There is always a Task item created for every Trigger and handled completely by the TaskEngine which is polling the Tasks. It takes care of trigger activation and performing cronjob this way.
I think you should use CronJobProgressTracker class as it saves data to the CronJobHistory item in every 5 seconds. And There are cron job events also that you can implement.
Please refer below links, might be helpful to you -
https://help.hybris.com/1808/hcd/b8004ccfcbc048faa9558ae40ea7b188.html
https://help.hybris.com/1808/hcd/2b87307fa7ee448886b78b62fe1bb9bc.html
Regards,
Prashant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.