⚙️ How Pages Are Generated: The Background Queue

Generating a thirty page book inside a single admin request would time out on most hosting. The plugin uses a background queue instead.

How the queue behaves:

  • A custom one minute WordPress cron schedule drives the queue tick.
  • Each tick processes up to three pending pages, so throughput is roughly three pages per minute.
  • Pages are processed in project order, then page order, so books finish in sequence rather than all at once.
  • When nothing is pending and no project is still generating, the queue unschedules itself. It reschedules automatically the next time you generate or reroll.

Failure isolation:

One page failing never stops the queue. A page that fails is marked failed with the provider's error message stored on the row, the tick moves to the next page, and the failed page shows its error on its card in the grid so you can reroll it.

Pages that need no image at all:

Journal template pages, plain text pages and algorithmic puzzle pages are marked done immediately by the queue. They are drawn as vectors at export time, so they cost nothing and complete instantly.

Why does progress seem to stall?

WordPress cron is triggered by site traffic, not by a real system timer. On a site with no visitors, ticks can be spaced further apart than a minute. Leaving the progress screen open keeps polling the site and therefore keeps ticks firing. A real server cron job pointed at wp-cron.php makes queue timing much more predictable on quiet sites.

Once every page has finished or failed, the project flips to review status automatically and the Publish tab stops warning you that the book is unfinished.

Ready to stop reading and start using?

Every plugin documented here works alongside the others, managed from one ResultsAIx Hub.