sidekiq-grouping 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: abbfc33064b0d62493579060635fbdd8449ab118
4
- data.tar.gz: 62f8fb16d37730fb087c78e2ea9ecc9a45d9a42a
3
+ metadata.gz: f9c96db0ae5af0c9a398f9e2a0718b55ede63741
4
+ data.tar.gz: 69adc754a26f5d4ba89f876f5e39803ba06d7e1f
5
5
  SHA512:
6
- metadata.gz: f82b31c45dedc4dd5f9c4b73ff4269c78f1ac7e3c564b4064a09575db15eff8dbf938003061f27836a0528945a62b820b6859f230e4b38882a824f63a005ea39
7
- data.tar.gz: c30f8345b87e05185f23e26febc766a3b0c857e0a905131dc9586935f8678108ebd3a569e5c5f8168ef225288a2c4834c2d86ca6a21ebd6b387f3eb8ed93ec86
6
+ metadata.gz: 80ae9e4599902073a2fd7336622f9b15b59f8cd3da25121b6d319dd2cb71f2aa2df56d9e14dbfe682f7b5b1d6d806c90a73cbaadd68f28bcf6f1e1655fa736aa
7
+ data.tar.gz: 086a0e13a585b06858d34752866099c9efa914139decaac83832dca5571d048ef8532a48cfe0395a92370f4c3554643afcb0f7a93d2330ab0fb517c757deae86
data/README.md CHANGED
@@ -12,6 +12,7 @@ Useful for:
12
12
 
13
13
  *NOTE:* As of 1.0 `batch_size` renamed to `batch_flush_size`.
14
14
  *NOTE:* As of 1.0.6 works with Sidekiq 4.
15
+ *NOTE:* As of 1.0.8 Locking is atomic (set nx/ex) and will no longer lead to batches that are permalocked and stuck
15
16
 
16
17
  ## Usage
17
18
 
@@ -2,6 +2,8 @@ module Sidekiq
2
2
  module Grouping
3
3
  class Middleware
4
4
  def call(worker_class, msg, queue, redis_pool = nil)
5
+ return yield if (defined?(Sidekiq::Testing) && Sidekiq::Testing.inline?)
6
+
5
7
  worker_class = worker_class.camelize.constantize if worker_class.is_a?(String)
6
8
  options = worker_class.get_sidekiq_options
7
9
 
@@ -52,11 +52,7 @@ module Sidekiq
52
52
  def lock(name)
53
53
  redis do |conn|
54
54
  id = ns("lock:#{name}")
55
- conn.setnx(id, true).tap do |obtained|
56
- if obtained
57
- conn.expire(id, Sidekiq::Grouping::Config.lock_ttl)
58
- end
59
- end
55
+ conn.set(id, true, nx: true, ex: Sidekiq::Grouping::Config.lock_ttl)
60
56
  end
61
57
  end
62
58
 
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Grouping
3
- VERSION = "1.0.7"
3
+ VERSION = "1.0.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-grouping
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Sokolov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-18 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  version: '0'
187
187
  requirements: []
188
188
  rubyforge_project:
189
- rubygems_version: 2.4.8
189
+ rubygems_version: 2.5.1
190
190
  signing_key:
191
191
  specification_version: 4
192
192
  summary: Allows identical sidekiq jobs to be processed with a single background call