Skip to content

Ouroboros does not re-enqueue #324

@CSigelmann

Description

@CSigelmann

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

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions