title: Rails background image upload causing application timeout
body: <p><strong>Unfortunately the bounty was awarded to an answer that does not solve this problem, for those with similar issues.</strong></p>
  
  <p>I have a form with an image upload (heroku to s3). When I submit the form, my rails server waits for the background job that uploads the image to finish before returning a response to the user. This causes an application timeout every single time there is an image upload.</p>
  
  <p>Current order of events:</p>
  
  <ol>
  <li>User submits form</li>
  <li>Server receives form</li>
  <li>If there is an image, server starts a background job</li>
  <li>If a background job was started, the server waits for it to complete (<em>rails times out here</em>)</li>
  <li>If started, the background job completes</li>
  <li>The server processes the request</li>
  <li>The server responds to the user</li>
  </ol>
  
  <p>Desired order of events:</p>
  
  <ol>
  <li>User submits form</li>
  <li>Server receives form</li>
  <li>Server processes non-image fields</li>
  <li>If there is an image, server starts a background job</li>
  <li>The server responds to the user</li>
  <li>The background job completes and the server processes the uploaded image (saves URL)</li>
  </ol>
  
  <p><strong>Uploader code</strong></p>
  
  <pre><code>class PhotoUploader &lt; CarrierWave::Uploader::Base
    include ::CarrierWave::Backgrounder::Delay
    include CarrierWave::MimeTypes
    process :set_content_type
    storage :fog
  end
  </code></pre>
  
  <p><strong>Carrierwave::Backgrounder initializer</strong></p>
  
  <pre><code>CarrierWave::Backgrounder.configure do |c|
    c.backend :sidekiq, queue: :carrierwave
  end
  </code></pre>
  
  <p><strong>User model</strong></p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    mount_uploader :photo, PhotoUploader, delayed: true
    process_in_background :photo
  end
  </code></pre>
  
  <p>There is no controller code because the form is handled by ActiveAdmin. I can override wherever is needed, but have not been able to figure out what needs to change.</p>
  
  <p>What do I have to change to get the correct order of events?</p>