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

Custom Locks with error #392

Closed
miguelseguray opened this issue May 14, 2019 · 7 comments
Closed

Custom Locks with error #392

miguelseguray opened this issue May 14, 2019 · 7 comments

Comments

@miguelseguray
Copy link

Hello,

I define some custom lock and I make the call in your project startup:

SidekiqUniqueJobs.configure do |config|
  config.add_lock :my_custom_lock, Locks::MyCustomLock
end
class MyWorker
  include Sidekiq::Worker
  sidekiq_options lock: :my_custom_lock
  def perform(args); end
end
gem 'sidekiq', '5.2.7'
gem 'sinatra', require: false
gem 'slim'
gem "sidekiq-cron", "1.1"
gem "sidekiq-status"
gem 'sidekiq-unique-jobs', '6.0.13'

but it does not work

/root/Proyectos/sidekiq/config/initializers/sidekiq_unique_jobs.rb:4:in `block in <top (required)>': undefined method `add_lock' for #<SidekiqUniqueJobs::Config:0x00562655cb8668> (NoMethodError)
        from /usr/local/rvm/gems/ruby-2.4.1/gems/sidekiq-unique-jobs-6.0.13/lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb:73:in `configure'
        from /root/Proyectos/sidekiq/config/initializers/sidekiq_unique_jobs.rb:3:in `<top (required)>'

@mhenrixon
Copy link
Owner

Super weird issue, if you have a look at the bundles source code : bundle open sidekiq-unique-jobs does the method exist on the config class then? When not could you check that the version is correct in the source?

Sent with GitHawk

@jimbodude
Copy link

The custom lock stuff was added post-6.0.13 release, according to git history:
v6.0.13...master#diff-a6cab90adb1364866afa90f4744c2cf5

@mhenrixon
Copy link
Owner

I’m that case I will cut a new release tonight.

@jimbodude
Copy link

Are you able to make that release? We're hoping to use these hooks in a project this week, and would rather not point at a git sha.

@mhenrixon
Copy link
Owner

I'm really sorry @jimbodude. Life has been really crazy with PSD2 deadlines, organizing the move to our new home and having two little girls 24 and 7 months old.

I'll get on it right away!

@jimbodude
Copy link

No worries, I know where you're coming from.

@mhenrixon
Copy link
Owner

Later versions should have this added so closing this issue.

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

3 participants