4

Given that the limit on the Apex Flex Queue is 100, what happens when it is time for the system to execute a Scheduled Job (of a Database.Batchable), but the Apex Flex Queue is maxed out at 100? Is there some platform magic that will make certain the scheduled job is run when resources are available, or does the Scheduled Job simply fail? This does not seem to be documented.

Thank you.

2
  • if the flex Queue exceed 100 then you will receive System.AsyncException: You have exceeded the maximum number (100) of Apex scheduled jobs. error.
    – Ratan Paul
    Commented Jan 11, 2016 at 9:09
  • @Ratan thank you very much. We will catch this and react accordingly. Commented Jan 11, 2016 at 15:26

1 Answer 1

4

If the job does not call a batch job, it will run normally (assuming resources are available); it may run later than specified, but it will still run. If the scheduleable class calls asynchronous code, then it will fail, so your scheduled job would need to try later. This is now a catchable exception, so you could choose to reschedule earlier than usual if you want a chance to run your batch again after a few minutes.

2
  • Thank you! Is it a LimitException or something different? This code will definitely call a Batchable class (I will amend the question to clarify this). I wish the docs would keep up. Commented Jan 11, 2016 at 14:17
  • 1
    I found it by just overwhelming the Flex Queue. It is System.AsyncException. Thank you very much! This is a great thing to have. Commented Jan 11, 2016 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .