function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sashamsasham 

Question regarding scheduling scheduler class

Hi 
I have scheduled scheduler class everyday at 1pm(through UI). It seems to be woeking in my staging sanbox. but when i see in the apex job . it is status as queued  and  it should have one staus at 1pm as completed if it was woring at 1 pm.  but as queued.
but i production i can see the status as failed and  staus detail as Scheduler: failed to execute scheduled job: jobId:456778999X class: common.apex.async.AsyncApexJobObject, reason: Apex CPU time limit exceeded.
My question  is It failed in production because cpu time exceeded but in staging why there isno staus as completed or failed but looks like it is working.

 
prateek jainprateek jain
Hi 
There is time limit which is given for an apex class to execute your class must be taking more time than given. to resolve your problem you must redefine your code and remove unnecessary code like loop etc  if you provide your code  we can what  problem it causing
Thanks