demarches-normaliennes/app/jobs
Pierre de La Morinerie 75a1046315 active_storage: refactor concerns
Follow-up of #5953.

Refactor the concerns with two goals:

- Getting closer from the way ActiveStorage adds its own hooks.
  Usually ActiveStorage does this using an `Attachment#after_create`
  hook, which then delegates to the blob to enqueue the job.
- Enqueuing each job only once. By hooking on `Attachment#after_create`,
  we guarantee each job will be added only once.

We then let the jobs themselves check if they are relevant or not, and
retry or discard themselves if necessary.

We also need to update the tests a bit, because Rails'
`perform_enqueued_jobs(&block)` test helper doesn't honor the `retry_on`
clause of jobs. Instead it forwards the exception to the caller – which
makes the test fail.

Instead we use the inline version of `perform_enqueued_jobs()`, without
a block, which properly ignores errors catched by retry_on.
2021-03-16 11:49:14 +01:00
..
api_entreprise zeitwerk: Api -> API 2021-02-09 13:07:30 +01:00
cron zeitwerk: Api -> API 2021-02-09 13:07:30 +01:00
application_job.rb Update Raven references to use Sentry 2021-01-28 19:46:36 +01:00
champ_fetch_external_data_job.rb Try to reduce the number of external data fetches 2021-03-11 14:56:37 +01:00
etablissement_update_job.rb zeitwerk: Api -> API 2021-02-09 13:07:30 +01:00
export_job.rb Run jobs in named queues 2020-09-23 08:22:17 +02:00
pipedrive_accepts_deals_job.rb [Fix #1736] Assign the deal and person to the person who accepted them 2018-06-07 16:04:15 +02:00
pipedrive_refuses_deals_job.rb [Fix #1736] Assign the deal and person to the person who accepted them 2018-06-07 16:04:15 +02:00
titre_identite_watermark_job.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
virus_scanner_job.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
web_hook_job.rb Run jobs in named queues 2020-09-23 08:22:17 +02:00