Commit graph

9 commits

Author SHA1 Message Date
Colin Darie
bfb98554ff
fix(active-storage): don't fail on analyzing a blob derivated by watermark
Quand l'analyse du job se produit après le watermark, elle doit comparer
le checksum avec celui du fichier filigrané.
2024-02-12 16:30:58 +01:00
Colin Darie
201b31bf36
refactor(watermark): small text based watermarked to increase document visibility 2023-09-12 13:04:31 +02:00
Paul Chavard
d469bca0ae refactor(watermark): use column instead of metadata on blob 2023-01-04 12:07:08 +01:00
Jon
88d3a6e4c3
feat: can have remote watemark file 2022-02-04 18:55:16 +01:00
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
Paul Chavard
0633d43868 Stop crashing if attachment can not be watermarked and mark blob as invalid 2021-01-27 16:49:09 +01:00
Paul Chavard
3c6e30a326 Show titre identite link only once watermark is added 2020-12-10 16:50:03 +01:00
Paul Chavard
18dfacb933 Make watermark configurable 2020-11-25 16:19:06 +01:00
Paul Chavard
371179dc5b Watermark titres identite 2020-11-25 16:19:06 +01:00