sidekiq-unique-jobs 6.0.23 → 6.0.24

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq-unique-jobs might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d6ae6134868752af2c74e22877099bf7d6d93113f149ba35881111007cf2249
4
- data.tar.gz: e59c474b8658e73fc85636c88114d848f52b49068e76447abfef0712fe357434
3
+ metadata.gz: c8ea40e3f79410d8c203d4df254cb6b9b756123b6aacaf15843843c4bd4337c5
4
+ data.tar.gz: 353ea6c92b0d945ad6571e0c20039c9df7093b74404d05a6e9633447e58827f9
5
5
  SHA512:
6
- metadata.gz: c4b7b71b5ddfff0fe559c70ec0067c4f6d2d6269632f9c9a01903a40506f385e4898cfb9b57c9d88634a1af98a9353ce9eaa74f1aa62e7e5619428984b52e99c
7
- data.tar.gz: c187ac55219ce9cccb812250c29e8509d1ea3e400218ddce3f6148065ec75a509f7f1a056d63bc0f712936e98361b261b96a216099c750464de298ac2896d59d
6
+ metadata.gz: 9c8c527b0a495bcd33672bf02afafadfe0b737394e2e357ca9d40d011ab5e5aaf6c927ae9c67e0bb7b4d2ebbfd43b485fa10e2fec97e3d0523371c3e06f8f1c7
7
+ data.tar.gz: ba00d25b2f3c6dc5d40cb472de73417c83e4c9c75005cd3339d80e86bb00964f34d8a0ea485e50af2406db025889e901610bc382af00588f82297d0fb16c9d97
data/README.md CHANGED
@@ -344,11 +344,17 @@ If you need to perform any additional work after the lock has been released you
344
344
  **Exception 1:** UntilExecuting unlocks and calls back before yielding.
345
345
  **Exception 2:** UntilExpired expires eventually, no after_unlock hook is called.
346
346
 
347
+ **NOTE:** _It is also possible to write this code as a class method._
348
+
347
349
  ```ruby
348
350
  class UniqueJobWithFilterMethod
349
351
  include Sidekiq::Worker
350
352
  sidekiq_options lock: :while_executing,
351
353
 
354
+ def self.after_unlock
355
+ # block has yielded and lock is released
356
+ end
357
+
352
358
  def after_unlock
353
359
  # block has yielded and lock is released
354
360
  end
@@ -35,7 +35,13 @@ module SidekiqUniqueJobs
35
35
  # The hook to call after a successful unlock
36
36
  # @return [Proc]
37
37
  def after_unlock_hook
38
- -> { worker_class.after_unlock if worker_method_defined?(:after_unlock) }
38
+ lambda do
39
+ if @worker_class.respond_to?(:after_unlock)
40
+ @worker_class.after_unlock # instance method in sidekiq v6
41
+ elsif worker_class.respond_to?(:after_unlock)
42
+ worker_class.after_unlock # class method regardless of sidekiq version
43
+ end
44
+ end
39
45
  end
40
46
 
41
47
  # Attempt to constantize a string worker_class argument, always
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqUniqueJobs
4
- VERSION = "6.0.23"
4
+ VERSION = "6.0.24"
5
5
  end
@@ -4,7 +4,7 @@ begin
4
4
  require "delegate"
5
5
  require "rack"
6
6
  require "sidekiq/web"
7
- rescue LoadError # rubocop:disable Lint/SuppressedException
7
+ rescue LoadError
8
8
  # client-only usage
9
9
  end
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-unique-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.23
4
+ version: 6.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-05 00:00:00.000000000 Z
11
+ date: 2020-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -317,7 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
317
317
  - !ruby/object:Gem::Version
318
318
  version: '0'
319
319
  requirements: []
320
- rubygems_version: 3.1.2
320
+ rubygems_version: 3.1.4
321
321
  signing_key:
322
322
  specification_version: 4
323
323
  summary: Sidekiq middleware that prevents duplicates jobs