lardawge/carrierwave_backgrounder

process_in_background not putting job in queue

amilano opened this issue · 14 comments

Greetings,

I've been checking the resolved issues and it seems that in the past this one was a common issue but apparently it was resolved. Now, I'm using carrierwave backgrounder 0.4.1 and the issue persists, although this version was published long after most of the reported bugs were marked as resolved.

Perhaps I'm not doing something properly...

My uploader:

    # delay image processing
    include ::CarrierWave::Backgrounder::Delay
    version :thumb do
        process :resize_to_fit => [200,200]
    end

My model:

    mount_uploader :src, ResourceUploader
    process_in_background :src
    # store_in_background :src

I'm using resque, so on the config file:

  CarrierWave::Backgrounder.configure do |c|
    c.backend :resque, queue: :carrierwave
  end

carrierwave's gem is 0.10.0
carrierwave_backgrounder is 0.4.1
rmagick is 2.13.2
and resque is 1.25.2

When I set in the model to store_in_background instead of process, I'm able to see the process running in the queue, but what I really need is to upload the original image to carrierwave and after that to process it with carrierwave_backgrounder... I really don't know why process_in_background doesn't put a task in the queue.

Was this still an issue in 0.4.1? should I go up to 0.4.2?

Thanks in advance for any help...

Yes, try 0.4.2.

Thanks for the quick response... I upgraded to 0.4.2, it still presents the same behavior. The original image is uploaded to carrierwave but there's no processing afterwards so the versions are never created.

It still puts the src_processing field in the model to "true" or "t" in my DB, but it never leaves this state and I'm never able to see the process entering into the carrierwave queue in resque.

Well, I've been trying to make this work and I'm still not able to get the background version processing running... I really don't know what I'm doing wrong.

Like I said before, the original image gets uploaded to my bucket through carrierwave, but after the saving process is done the process_in_background directive never seem to be able to place a task in rescue.

Works fine with store_in_background, but not for process_in_background.

I must be doing something wrong or there it might actually be a bug in gem(?)

Are you running the correct queue? Sounds like the 'carrierwave' queue is not running...

bin/resque work --queues=default,carrierwave

I'm sure it is running cause I have a few other workers doing things after records are saved... and the store_in_background goes to resque without a problem

screen shot 2015-10-19 at 7 39 31 pm

This is how I run resque: rake resque:work QUEUE=*

I even placed a "puts" into a method to be called on the versioning, to see if actually the code gets there and check if there was an exception not being logged or something... but the flag never gets printed into my logs

Turn the queue off and see if a job get's added.

the carrierwave queue specifically? or every queue?

Here, waiting for the queue to be on again

screen shot 2015-10-19 at 7 59 23 pm

carrierwave specifically. I want to see if a job gets added so we know if it is an issue with the worker of the model.

Got it... well I actually turned off resque and the jobs on the screenshot were the only ones who made it to the queues while it was down.

is there a way to manually put into the queue the task after the model is saved? or is it automatically tied to the save/update process of the model?

I'm closing this issue... I wasn't able to make work the process_in_background option... It never got any version processing task into the respective queue although all my other workers were doing just fine.

I'm not sure if it's a bug on the gem or something related to my app configuration. I implemented my own background version processing mechanism and dropped the use of the gem.

Thanks anyway for the time and help provided.

+1 same issue here ..