Queue action save doesn't save data

I have following code on my save event:

This is executed fine, but doesn’t save anything when items are over 1000.

  • Which document is this? Saving 1000 items is not a big deal, why do you need to queue this action? Usually, problems arise when submitting transactions that validate and create other documents based on the number of items (like GL/SL Entries)
  • Since you’ve not specified any timeout, the default of 300 seconds is used, so maybe it’s getting timed out? Go to “Background Jobs” and “Show failed jobs”
  • Check scheduler status. bench doctor

Is a custom document. 1000 is just a test, would may be 20000, and this case fail. I did test saving 10 items with queue_action, but it not saved either. I did track steps in document.py and background_jobs.py, and data of document does not is passed.

What would be a good strategy to be able to save a document that has many children (over 10,000) in a child table?