Skip to content

Background jobs - #71

Merged
anoziere merged 52 commits into
thelia:mainfrom
ThomasDaSilva:docs/281-background-jobs
Oct 23, 2026
Merged

anoziere merged 52 commits into
thelia:mainfrom
ThomasDaSilva:docs/281-background-jobs

Conversation

@ThomasDaSilva

@ThomasDaSilva ThomasDaSilva commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor
  • Architecture: when to dispatch a message rather than an event, the transports, why nothing waits by default, the allow list and the checks on queued mails, retries, how the back office and the workers share a failed job, what a worker sees (the request each job gets), what a failure shows, personal data.
  • Reference: settings, commands, the back-office screen, exports and imports, the scheduler, and a complete module (StockSync) with its own queue and a recurring task. The example was run as written.
  • Getting started: running workers with supervisor, systemd, cron or DDEV, monitoring with messenger:stats, stopping them for a deployment, the folders the web server and the workers share.
  • Security: what the background jobs keep, for how long, and what deletes it, including the file of a failed import deleted from the back office.
  • Upgrading: the 3.3 notes in Updating (the Symfony recipes to undo, emptying the queues before going back to none), and a Thelia 3.3 section in Breaking changes for module authors.
  • The threat model of a queue (what a writer to a Redis or AMQP queue can do), and the failed jobs purged by maintenance:purge.
  • Operations: which cache clear stops the workers by itself and which needs messenger:stop-workers, the locks an import holds and the listeners that run inside its transaction, how a module routes its messages (configureContainer() or #[AsMessage]) and why a queue of its own needs a worker of its own, and the crontab fallback without scheduler_thelia when the tasks stay in a crontab.
  • Retention: job rows and import files kept 31 days, a day past the failed jobs; the archive limit counts folders too.
  • Known limits, accepted for this version (Reference, Idempotence and replay): a job replayed from the back office and with messenger:failed:retry at the same moment may be sent twice, and a mail sent with the Symfony mailer directly, not through MailerFactory, is not guarded against a second delivery.
  • Fixed on the way: the order history page said MailerFactory writes the email_sent line; OrderEmailHistoryListener does, once the mail server accepted the mail.
  • Pages are in docs/ only: the feature ships with 3.3.

Documents thelia/thelia#4079 and thelia-templates/default-twig#126. The branch is rebased on main.

Merge order

  1. Install Messenger and Scheduler without a default queue nor a default schedule thelia-recipes#14: the CI of the core installs its recipes.
  2. Background jobs with Symfony Messenger, a scheduler, and export and import jobs thelia#4079, with Background jobs #71.
  3. The 3.3 releases of thelia/config (the new tables) and thelia/setup, then the core requiring them.
  4. Background jobs screen, exports and imports as jobs thelia-templates/default-twig#126: it requires thelia/core ^3.3.
  5. Declare an empty job queue in .env.dist thelia-project#74.

…oup, and a folder made before keeps its mode
@ThomasDaSilva
ThomasDaSilva force-pushed the docs/281-background-jobs branch from 0e4edf1 to 3835d7e Compare October 22, 2026 08:28
@anoziere
anoziere merged commit fb38147 into thelia:main Oct 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants