-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
In Ouroboros, it does not re-enqueue because it thinks it is unsafe to do so.
In safeToEnqueueAccordingToLimits, the following line is always returning false:
return (Limits.getLimitQueueableJobs() - (Limits.getQueueableJobs() + 1) > 0
Limits.getLimitQueueableJobs() returns 1 for async code
Limits.getQueueableJobs() returns 0 if no additional jobs have been enqueued
Thus safeToEnqueueAccordingToLimits thinks it is not safe to enqueue the next job.
I believe this can be fixed by removing the +1. I'd be interested to know the purpose of that part of the statement.
Salesforce Org Type
Scratch Org
Steps To Reproduce
Create an Ouroboros that re-enqueues itself a few times.
Current Behavior
Only the first iteration runs
Expected Behavior
Ouroboros re-enqueues jobs until the exit criteria is met
Relevant Log Output
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working