-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Conversation
rebuild_model styles: {thumb: "100x100"}, | ||
only_process: [:none], | ||
process_in_background: [:thumb] | ||
@file = File.new(fixture_file("5k.png"), 'rb') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
it "processes styles marked for background processing" do | ||
file = File.new(fixture_file("5k.png"), "rb") | ||
FileUtils.cp(file, "tmp/public/system/dummies/avatars/000/000/001/original/5k.png") | ||
rebuild_model styles: {thumb: "100x100"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space inside { missing.
Space inside } missing.
require "active_job" | ||
rescue LoadError | ||
raise LoadError, | ||
"To use background processing you have to include 'active_job' in load path" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align the parameters of a method call if they span more than one line.
I'm also wondering how configuration for future features should look like, in example: |
only_process: [:none], | ||
process_in_background: [:thumb] | ||
|
||
dummy = Dummy.create!(avatar_file_name: "5k.png", avatar_processing_in_background: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [92/80]
As a maintainer of DelayedPaperclip, I'd love for this to be in Paperclip core. Much less hacky and easier to maintain in the future. |
@tute Do you think we can move it forward? |
How would callbacks work if this is integrated? I have a potential use case that looks quite a lot like the one described here: jrgifford/delayed_paperclip#176 |
any update on this PR? |
We are in the process of deprecating paperclip, and so are closing PRs that aren't immediate bug fixes or documentation updates. Thanks for your contribution, we regret not tending to it! |
Very basic implementation for background processing support using ActvieJob.
It requires more work, but I would like to start collecting your feedback about implementation and possible features.
I tested it with file and s3 storages locally.
Questions:
I think it make sense to add db column where we can mark that file is being processed () - do you think booleandone:attachment_name:_processing_in_background
is fine?process_in_background
options, but also setonly_processing
to fake[:none]
, as empty array processes all by default. I would like to solve it some better way. How it should behave?[ref #2260]