sidekiq-limit_fetch 3.2.1 → 3.3.0

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: ca083933d1ef02f0cc4311954a1a0a8c82c9a0e0
4
- data.tar.gz: fb76a0812ae751d02f39aeea371b37a780b6d1d0
3
+ metadata.gz: e3cffb46d9e10cd316b080cef7fbdee888d65b7a
4
+ data.tar.gz: 0a944880dee77b36ad0416578c1f8f00058004c5
5
5
  SHA512:
6
- metadata.gz: 26f18118cbcf8896bf8fdf070438eb42a3f10658e6e413ed2bec88526a474857d38766bbea508b8f00081013a03ebb84eb47c1943ccd04b9150f91e11ee79df7
7
- data.tar.gz: db1ac7268dd03b5bc28e72e9b2cef9d68e5cb606f9adb4819add906e0d2b6026d658d56d1595117955e26628eca03f05c5c4db44949f6157cac6e50c47570aa2
6
+ metadata.gz: e2cb38b4b8b35761c10150975aa0d15396b3c7885d0f02299ef8e7cf977162fcc4145c11b565a404e724ceaebb2d78e9dd392bd834776b846aaf1f5df192128b
7
+ data.tar.gz: 454b3e24b94f167245a416528d70867c3917dd41fd69669492bb2e47d41aa0d04aba854300da84f8a5e2d706b6e8272ec4dac87a37e44bbe14f67fe6d895022d
@@ -1,7 +1,10 @@
1
1
  language: ruby
2
+ before_install:
3
+ - gem install bundler
4
+ - gem update bundler
2
5
  rvm:
3
- - 2.3
4
- - 2.2
5
- - jruby
6
+ - 2.3.1
7
+ - 2.2.5
8
+ - jruby-head
6
9
  services:
7
10
  - redis-server
@@ -30,6 +30,13 @@ module Sidekiq::LimitFetch
30
30
  Sidekiq::BasicFetch.bulk_requeue(*args)
31
31
  end
32
32
 
33
+ def redis_retryable
34
+ yield
35
+ rescue Redis::BaseConnectionError
36
+ sleep 1
37
+ retry
38
+ end
39
+
33
40
  private
34
41
 
35
42
  TIMEOUT = Sidekiq::BasicFetch::TIMEOUT
@@ -10,9 +10,12 @@ module Sidekiq::LimitFetch::Global
10
10
  def start!(ttl=HEARTBEAT_TTL, timeout=REFRESH_TIMEOUT)
11
11
  Thread.new do
12
12
  loop do
13
- add_dynamic_queues
14
- update_heartbeat ttl
15
- invalidate_old_processes
13
+ Sidekiq::LimitFetch.redis_retryable do
14
+ add_dynamic_queues
15
+ update_heartbeat ttl
16
+ invalidate_old_processes
17
+ end
18
+
16
19
  sleep timeout
17
20
  end
18
21
  end
@@ -23,7 +23,10 @@ module Sidekiq::LimitFetch::Queues
23
23
  def release_except(full_name)
24
24
  queues = restore
25
25
  queues.delete full_name[/queue:(.*)/, 1] if full_name
26
- selector.release queues, namespace
26
+
27
+ Sidekiq::LimitFetch.redis_retryable do
28
+ selector.release queues, namespace
29
+ end
27
30
  end
28
31
 
29
32
  def dynamic?
@@ -2,17 +2,23 @@ module Sidekiq
2
2
  class LimitFetch::UnitOfWork < BasicFetch::UnitOfWork
3
3
  def initialize(queue, job)
4
4
  super
5
- Queue[queue_name].increase_busy
5
+ redis_retryable { Queue[queue_name].increase_busy }
6
6
  end
7
7
 
8
8
  def acknowledge
9
- Queue[queue_name].decrease_busy
10
- Queue[queue_name].release
9
+ redis_retryable { Queue[queue_name].decrease_busy }
10
+ redis_retryable { Queue[queue_name].release }
11
11
  end
12
12
 
13
13
  def requeue
14
14
  super
15
15
  acknowledge
16
16
  end
17
+
18
+ private
19
+
20
+ def redis_retryable(&block)
21
+ Sidekiq::LimitFetch.redis_retryable(&block)
22
+ end
17
23
  end
18
24
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'sidekiq-limit_fetch'
3
- gem.version = '3.2.1'
3
+ gem.version = '3.3.0'
4
4
  gem.license = 'MIT'
5
5
  gem.authors = 'brainopia'
6
6
  gem.email = 'brainopia@evilmartians.com'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-limit_fetch
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - brainopia
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-17 00:00:00.000000000 Z
11
+ date: 2016-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -17,13 +17,13 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4'
20
- type: :runtime
21
- prerelease: false
22
20
  version_requirements: !ruby/object:Gem::Requirement
23
21
  requirements:
24
22
  - - ">="
25
23
  - !ruby/object:Gem::Version
26
24
  version: '4'
25
+ prerelease: false
26
+ type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: redis-namespace
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -34,8 +34,6 @@ dependencies:
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
36
  version: 1.5.2
37
- type: :development
38
- prerelease: false
39
37
  version_requirements: !ruby/object:Gem::Requirement
40
38
  requirements:
41
39
  - - "~>"
@@ -44,6 +42,8 @@ dependencies:
44
42
  - - ">="
45
43
  - !ruby/object:Gem::Version
46
44
  version: 1.5.2
45
+ prerelease: false
46
+ type: :development
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -51,13 +51,13 @@ dependencies:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
- type: :development
55
- prerelease: false
56
54
  version_requirements: !ruby/object:Gem::Requirement
57
55
  requirements:
58
56
  - - ">="
59
57
  - !ruby/object:Gem::Version
60
58
  version: '0'
59
+ prerelease: false
60
+ type: :development
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rake
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -65,13 +65,13 @@ dependencies:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
- type: :development
69
- prerelease: false
70
68
  version_requirements: !ruby/object:Gem::Requirement
71
69
  requirements:
72
70
  - - ">="
73
71
  - !ruby/object:Gem::Version
74
72
  version: '0'
73
+ prerelease: false
74
+ type: :development
75
75
  description: |2
76
76
  Sidekiq strategy to restrict number of workers
77
77
  which are able to run specified queues simultaneously.
@@ -121,7 +121,7 @@ homepage: https://github.com/brainopia/sidekiq-limit_fetch
121
121
  licenses:
122
122
  - MIT
123
123
  metadata: {}
124
- post_install_message:
124
+ post_install_message:
125
125
  rdoc_options: []
126
126
  require_paths:
127
127
  - lib
@@ -136,9 +136,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
- rubyforge_project:
140
- rubygems_version: 2.5.1
141
- signing_key:
139
+ rubyforge_project:
140
+ rubygems_version: 2.6.4
141
+ signing_key:
142
142
  specification_version: 4
143
143
  summary: Sidekiq strategy to support queue limits
144
144
  test_files: