Why would a background task not complete when ran as cron but complete when ran manually

I have a task that modifies a list of records.

When i run this, it takes 30 seconds, roughly. When it's ran as a cron it wont finish and will sometimes invoke itself several times before finishing any single invocation.

the task is relatively simple but you can see here that it runs for long periods of time without finishing and will have several instances of the same task Processing at the same time


  • jaredGibb
    jaredGibb Member ✭

    it only seems to be getting worse. would love any insights

  • jaredGibb
    jaredGibb Member ✭

    curiously, one of the instances appears to have finished based on the data in the DB. still having this odd issue.

    also, theres no way the task takes that long. period.

  • Michael Udinski
    Michael Udinski Administrator


    Hey @jaredGibb - it will be hard to diagnose without knowing details about the function stack, database, and instance resource graph. If you write into support we should be able to help take a closer look at these things.

    Also, Run&debug will almost always be faster than a background task run because run&debug uses API resources, background tasks are going to be slower by nature but can handle longer run times for process-intensive function stacks. (More of an FYI than anything)

  • jaredGibb
    jaredGibb Member ✭

    That's understandable. I have already contacted support and am waiting patiently. I'm seeing really weird stuff with these executions.

    I understand run and debug is faster, BUT 30 seconds compared to 60 minutes doesn't compute in my head. According to my logs the executions finally did finish but they took over an hour