sidekiq-throttled 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6aedce59e6d54d8e5b87efee69f613db617d7549
4
- data.tar.gz: 6e8ec470ea953aa7fd43f0a4962dc1a1590538c6
3
+ metadata.gz: 3f24a091044117cd299dc478eca0cdf2592b7e05
4
+ data.tar.gz: 18cd12c9b4a9a8e4ce273f959a4deae29c7d2c14
5
5
  SHA512:
6
- metadata.gz: b5b30e4cc7703c5d40882b43efc78da6cc514af7134f9e22909ee30018778012d4ac193f53cb6f71fa0babc0800bf5601aa93011e0390caed04dfa11e6fe0d32
7
- data.tar.gz: d94c1159801231e63725d7d55cdd92587248bc1f1bda4d8c6f089c3e1abc0d1341375740263f33e68037e9af08f7e92b364c2b545ca263cb9a19a82be8868568
6
+ metadata.gz: d02ac4f96d6aaf4cae1d0b2a5958efbef48d86410c18b933f9da3fb492c5e6487a7dd6bcf612e1858e0bd0c355827f6b6071341ea2b42ad73b9f59d805cfe8d6
7
+ data.tar.gz: e9c0d68e0fc016cdbd5369f8d342339fde7c0e67f40cd1a1446025839ccbf7f9c26f9eabed5fafa8521387d93ae3bb61483cfd2f5cae6722488833fc90148939
data/CHANGES.md CHANGED
@@ -1,6 +1,12 @@
1
+ ## 0.6.5 (2016-09-04)
2
+
3
+ * Fix concurrency throttling when redis-namespace is used.
4
+ ([@ixti])
5
+
6
+
1
7
  ## 0.6.4 (2016-09-02)
2
8
 
3
- * Rename UNitOfWork throttled requeue to `#requeue_throttled`.
9
+ * Rename UnitOfWork throttled requeue to `#requeue_throttled`.
4
10
  ([@ixti])
5
11
 
6
12
 
@@ -22,6 +22,7 @@ module Sidekiq
22
22
  # # Emit message from console
23
23
  # Sidekiq.redis do |conn|
24
24
  # Communicator.instance.transmit(conn, "knock", "ixti")
25
+ # end
25
26
  class Communicator
26
27
  include Singleton
27
28
  include ExceptionHandler
@@ -33,6 +33,7 @@ module Sidekiq
33
33
  return work unless work.throttled?
34
34
 
35
35
  work.requeue_throttled
36
+ sleep TIMEOUT
36
37
 
37
38
  nil
38
39
  end
@@ -1,7 +1,7 @@
1
1
  local key = KEYS[1]
2
- local jid = KEYS[2]
3
- local lmt = tonumber(ARGV[1])
4
- local ttl = tonumber(ARGV[2])
2
+ local jid = ARGV[1]
3
+ local lmt = tonumber(ARGV[2])
4
+ local ttl = tonumber(ARGV[3])
5
5
 
6
6
  if lmt <= redis.call("SCARD", key) and 0 == redis.call("SISMEMBER", key, jid) then
7
7
  return 1
@@ -44,7 +44,7 @@ module Sidekiq
44
44
 
45
45
  # @return [Boolean] whenever job is throttled or not
46
46
  def throttled?(jid, *job_args)
47
- 1 == SCRIPT.eval([key(job_args), jid.to_s], [limit(job_args), @ttl])
47
+ 1 == SCRIPT.eval([key(job_args)], [jid.to_s, limit(job_args), @ttl])
48
48
  end
49
49
 
50
50
  # @return [Integer] Current count of jobs
@@ -55,7 +55,7 @@ module Sidekiq
55
55
  # Resets count of jobs
56
56
  # @return [void]
57
57
  def reset!(*job_args)
58
- Sidekiq.redis { |conn| conn.del(key(job_args)) }.to_i
58
+ Sidekiq.redis { |conn| conn.del(key(job_args)) }
59
59
  end
60
60
 
61
61
  # Remove jid from the pool of jobs in progress
@@ -3,6 +3,6 @@
3
3
  module Sidekiq
4
4
  module Throttled
5
5
  # Gem version
6
- VERSION = "0.6.4".freeze
6
+ VERSION = "0.6.5".freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-throttled
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey V Zapparov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-02 00:00:00.000000000 Z
11
+ date: 2016-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq