Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning: already initialized constant BaseJob #45

Open
prashantvithani opened this issue Apr 20, 2016 · 1 comment
Open

warning: already initialized constant BaseJob #45

prashantvithani opened this issue Apr 20, 2016 · 1 comment

Comments

@prashantvithani
Copy link

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 prashantvithani changed the title warning: already initialized constant BasJob warning: already initialized constant BaseJob Apr 20, 2016
@dkobia
Copy link

dkobia commented Aug 21, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants