jamessimone / apex-rollup

Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.
MIT License
220 stars 30 forks source link

Check OrgLimit class prior to going async #450

Closed jamessimone closed 1 year ago

jamessimone commented 1 year ago

Currently, Apex Rollup defaults to an async-first approach when performing calculations, but if an org is already at or over their daily AsyncApexJob execution limit, trying to go async will throw an uncatchable System.LimitException.

While still operating in a sync context, that limit should be checkable and the framework can instead calculate synchronously to avoid this uncatchable exception.