sidekiq-superworker icon indicating copy to clipboard operation
sidekiq-superworker copied to clipboard

warning: already initialized constant BaseJob

Open prashantvithani opened this issue 8 years ago • 1 comments

I get this warning when I start my rails console after defining the superworker.

Superworker.define(:BaseJob, :product_items, :template_hash, :user_id) do
  batch product_items: :items do
    TheJob :items, :template_hash
  end

  AnotherJob :user_id
end

and I get the below warning

/Users/prashantvithani/.rvm/gems/ruby-2.2.2/gems/sidekiq-superworker-1.2.0/lib/sidekiq/superworker/worker.rb:28: warning: already initialized constant BaseJob
/Users/prashantvithani/.rvm/gems/ruby-2.2.2/gems/sidekiq-superworker-1.2.0/lib/sidekiq/superworker/worker.rb:28: warning: previous definition of BaseJob was here

I have not defined BaseJob anywhere else except here. (I have used BaseJob as illustration, actual name is different)

prashantvithani avatar Apr 20 '16 10:04 prashantvithani

Seems the initializer with Dir['./app/superworkers/*'].each { |f| require f } is unnecessary because the superworkers are autoloaded?

dkobia avatar Aug 21 '16 17:08 dkobia