Skip to content
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

Conversation

@guns
Copy link

@guns 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

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
Copy link
Owner

@jstorimer 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 issue Jun 23, 2011
…_delete

Avoid queuing jobs that have been marked for deletion
@jstorimer jstorimer merged commit d732373 into jstorimer:master Jun 23, 2011
ScotterC referenced this issue in ScotterC/delayed_paperclip Apr 24, 2013
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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants