title: How to set retry count for Sidekiq with ActiveJob?
body: <p>From the Rails API, I found ActiveJob can retry_job interval:</p>
  
  <pre><code>my_job_instance.enqueue
  my_job_instance.enqueue wait: 5.minutes
  my_job_instance.enqueue queue: :important
  my_job_instance.enqueue wait_until: Date.tomorrow.midnight
  </code></pre>
  
  <blockquote>
    <p><a href="http://api.rubyonrails.org/classes/ActiveJob/Enqueuing.html">http://api.rubyonrails.org/classes/ActiveJob/Enqueuing.html</a></p>
  </blockquote>
  
  <p>But if I want to set retry count, such as Sidekiq's:</p>
  
  <pre><code>include Sidekiq::Worker
  sidekiq_options :retry =&gt; 5
  </code></pre>
  
  <blockquote>
    <p><a href="https://github.com/mperham/sidekiq/wiki/Error-Handling">https://github.com/mperham/sidekiq/wiki/Error-Handling</a></p>
  </blockquote>
  
  <p>How to do in this sample code?</p>
  
  <pre><code>class SiteScrapperJob &lt; ActiveJob::Base
    rescue_from(ErrorLoadingSite) do
      retry_job queue: :low_priority
    end
  
    def perform(*args)
      # raise ErrorLoadingSite if cannot scrape
    end
  end
  </code></pre>
  
  <p>Now I added this to my job class:</p>
  
  <pre><code>Sidekiq.default_worker_options = { retry: 5 }
  </code></pre>
  
  <p>But it seems not very good.</p>