I have a loop:
Dir.new("#{RAILS_ROOT}/public/images/vehicles/uploaded/ #{@vehicle.id}").each do |image| if image =~ /.*\.jpg$/i @vehicle_image = VehicleImage.new() @vehicle.vehicle_images << @vehicle_image File.cp("#{RAILS_ROOT}/public/images/vehicles/uploaded/ #{@vehicle.id}/#{image}", "#{RAILS_ROOT}/public/images/vehicles/ original/#{@vehicle_image.id}.jpg") MiddleMan.new_worker(:class => :resizeimage_worker, :args => {:id => @vehicle_image.id, :basepath => "#{RAILS_ROOT}/public/images/ vehicles/"}) end end
It appears to be waiting for MiddleMan.new_worker to return before continuing to the next iteration. Im sure I must be doing something wrong here - as this would defeat the whole point of backgroundrb?
Any thoughts?
Kind Regards,
Matt Williams