Skip to content

Instantly share code, notes, and snippets.

@the-teacher
Last active October 27, 2015 07:05
Show Gist options
  • Save the-teacher/6329d9338d6a2e6e366a to your computer and use it in GitHub Desktop.
Save the-teacher/6329d9338d6a2e6e366a to your computer and use it in GitHub Desktop.
sidekiq, action job
module MyBackend
  class Application < Rails::Application
    config.autoload_paths << Rails.root.join('lib')
    config.active_job.queue_adapter = :sidekiq
  end
end

PREVENT: RuntimeError (Circular dependency detected while autoloading constant MyClass)

Rails.application.configure do
  config.eager_load = true
end
require 'some_lib'

class PushNotificationJob < ActiveJob::Base
  queue_as :default

  def perform(*args)
    PushNotificationSender.send_notification data
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment