New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid queuing jobs that have been marked for deletion #19

Merged
merged 1 commit into from Jun 23, 2011

Conversation

Projects
None yet
2 participants
@guns
Copy link

guns commented Oct 26, 2010

Hi,

I just started using delayed_paperclip today and I noticed that the enqueue_job_for_#{name} was inserting reprocess! jobs into DJ table when a record was deleted.

Turns out Paperclip does an intermediary update that sets all paperclip attributes to nil. This triggers the :after_save event, which triggers the enqueue method. This stinks on Paperclip's part, but I guess sometimes you just deal.

I couldn't get the test environment to work for me, but I didn't spend a lot of time at it (I'm actually at a client's now). If you would like a test, I can get that for you later.

Cheers, and thanks for your work!

Sung

guns
avoid queueing job when the attachment has been marked for deletion
When deleting a record that has_attached_file, paperclip temporarily
sets all paperclip attributes to nil until the deletion is complete.

However, this triggers the :after_save callback and erroneously queues
a job that can never be completed since the record will no longer exist.
@jstorimer

This comment has been minimized.

Copy link
Owner

jstorimer commented Nov 17, 2010

This looks alright but a test would be great! If you're up for it but can't get the test env working just let me know and I can lend a hand.

jstorimer added a commit that referenced this pull request Jun 23, 2011

Merge pull request #19 from guns/do-not-trigger-on-queue_existing_for…
…_delete

Avoid queuing jobs that have been marked for deletion

@jstorimer jstorimer merged commit d732373 into jstorimer:master Jun 23, 2011

ScotterC referenced this pull request in ScotterC/delayed_paperclip Apr 24, 2013

Merge pull request jrgifford#19 from FulcrumTechnologies/master
Use default_url when no file is provided or is not processing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment