+ Start a Discussion

Error in execution of cron job: Failed to process batch for class 'Job2'


We have following scenario for the chained batch jobs in our app.
In the finish of first batch job, next job is scheduled with the help of cron expression. we are adding 2 seconds to current time as
buffer as the SF may take time to schedule the job.


     job2.schedule(current time + 2 seconds);


Actual execution may be delayed based on service availability.

sometimes we are gtting error  : Failed to process batch for class 'analysis2_TEST' for job id '707E0000003JRVw'
caused by: System.AsyncException?: Based on configured schedule, the given trigger will never fire.

What should the ideal time dealy we need to add so that we are sure that the job will be alwayed fired.