sidekiq-superworker
sidekiq-superworker copied to clipboard
warning: already initialized constant BaseJob
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)
Seems the initializer with Dir['./app/superworkers/*'].each { |f| require f }
is unnecessary because the superworkers are autoloaded?