Hi so we have a couple of Apex batch jobs that run continuously in our org. One runs every five minutes and one runs every fifteen minutes. In the batch's finish methods, the two reschedule themselves appropriately. However, the past couple of weeks, the jobs have been randomly not scheduling without warning. The last job to run doesn't have any errors but will not schedule.
The gap in the middle is where we noticed the issue and restarted the job. I'm attempting to enable debug logs but it's difficult without knowing when or why the scheduling doesn't happen.
Messaging_SendMessageBatchScheduler__c msgBatchSchedular = Messaging_SendMessageBatchScheduler__c.getValues('Batch Scheduling Time');
if(msgBatchSchedular != null){
Integer scheduleTime = Integer.valueOf(msgBatchSchedular.RC_SMS_Status_Batch_ScheduleTime_In_Mins__c);
if(scheduleTime != null){
if(!Test.isRunningTest()){
System.scheduleBatch(new Messaging_RCSMSStatusBatch(), 'Check Sent SMS Status Batch', scheduleTime, 70);
}
}
}
That's the finish method.
System.scheduleBatch
returns and gain insight.