delayed_paperclip icon indicating copy to clipboard operation
delayed_paperclip copied to clipboard

image_processing set to false before s3 write finishes

Open jaredmoody opened this issue 13 years ago • 6 comments

I'm occasionally getting 406 responses from s3 after requesting an image that just finished processing. I put in debug lines in paperclip/storage/s3.rb flush_writes and delayed_paperclip/attachment.rb post_process_styles_with_processing and it looks to me like the _processing column is getting set to false just before the writes are flushed to s3, which seems like a bug to me.

Has anyone else seen this happening? Not sure what the best approach is here as I'm not too familiar with paperclip internals and not sure if this is a paperclip or delayed_paperclip problem.

I'm using ree-1.8.7-2012.02, paperclip 2.7.1, and delayed_paperclip 2.4.5.2

jaredmoody avatar Oct 17 '12 22:10 jaredmoody

It might be a paperclip problem, we are running a ancient version of paperclip right now. I'm working on updating paperclip to 3.0, so this might resolve the problem.

Can you try this branch?

jrgifford avatar Oct 17 '12 22:10 jrgifford

I can't use the paperclip 3 branch since I'm not on ruby 1.9.3 yet, so until then I'm on paperclip 2.7.1. Should I try the master branch from your fork or is that the same as 2.4.5.2?

jaredmoody avatar Oct 17 '12 23:10 jaredmoody

Here's a solution that's working for me:

https://github.com/elevation/delayed_paperclip/commit/15c670a3f9045bddd858dd6f603e15bf53de1b58

I just changed the alias method chain to hook into after_flush_writes instead of post_process_styles.

That work?

jaredmoody avatar Oct 17 '12 23:10 jaredmoody

Master is (with a few minor diffs) the same as the current release.

Also, that gist is deleted - can you repost?

jrgifford avatar Oct 18 '12 00:10 jrgifford

I updated my post to point to the commit in my fork, sorry about that. Refresh?

jaredmoody avatar Oct 18 '12 00:10 jaredmoody

Ah, ok. I see it now. Thanks!

jrgifford avatar Oct 18 '12 01:10 jrgifford