lardawge/carrierwave_backgrounder

No version images available after background processing is complete

Closed this issue · 3 comments

I am using s3, carrierwave, delayed_job and mongodb (not using embedding).
In my setup I use process_in_background

All of the jobs were run and complete

...
...
...
[Worker(host:jude pid:24757)] CarrierWave::Workers::ProcessAsset completed after 21.5198
[Worker(host:jude pid:24757)] 20 jobs processed at 0.0626 j/s, 0 failed ...

But accessing different image versions points to default or the fallback image

@property.image.url  //shows http:example.s3.amazon/example.jpg (this is ok)
@property.image.thumb_lg.url  //points to default/fallback image. (no file found)

@vinchi777 Same thing happening here, find any fix for this?

@vinchi777 Same here, Rails 4.2.4, Carrierwave 0.10.0 and Carrierwave-Aws 1.0.0

@cseelus Just a heads up, I did end up figuring out what mine was doing! It WAS uploading them, but it was applying the timestamp twice (once on upload and once again when it was processed). So my files ended up being saved like "small_12345678_23456789_upload.png". I set it to only add the timestamp if there was no instance variable set (aka if it hadn't done it yet) and that seemed to fix up the problem!

This isn't flawless, but it's working :)

def filename
  var = :"@#{mounted_as}_timestamp"
  stamp = !model.instance_variable_get(var) ? "#{timestamp}-#{super}" : "#{super}"

  @name ||= stamp if original_filename.present? and super.present?
end