sidekiq-pauzer 3.0.0 → 3.1.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
  SHA256:
3
- metadata.gz: b7ad60f6b5eadbbf347139ad0eaef9962e1983f90cf84bf5d1b409bb19ddfc4d
4
- data.tar.gz: 01ff41aac0537faad75897dfa15a2427f00ee6d3a04e9b40ac686d8a52b05770
3
+ metadata.gz: '093ae8e3f39076f2722fdd8e78429d65ff4bf960a3c9b402a021235656ca24c1'
4
+ data.tar.gz: 36012fc8092f03f70006e4c6fefe93b85a50036d48cb3d2b32370d229daa182c
5
5
  SHA512:
6
- metadata.gz: bd6aa63500df79f60d3fe1c65fb05e51c6dda01f2e431fe5637d4431220a01bcdf5255626cb484dcc08d8077652fb7746c52c17e68ff0acf3e5898608707213f
7
- data.tar.gz: 2197a6faf19fae846a04f5f75271af586041b751f6a06a49d6cf5cb9e351a5c496db502a6cdfc38490eb314a2b3d84becaf20550cea59d1828f1ad5c463a5da9
6
+ metadata.gz: 0005bfd0f7ad351f00b32e9e4444ec394e88e9a1510458757c1c365169bfc34672ed719f786b072afebb598827aef7e7e8e25cc4bf4bfee1bfd776393a71a00a
7
+ data.tar.gz: 659c74e2b8709af5704a46b86ff3e2ccd6eda2e0bb8d1cd973386d5be031fc9ba5737485cc59900ee808897f0d33bb5d667b3d53920919eec50a8ef7ffbb4729
@@ -10,17 +10,7 @@ module Sidekiq
10
10
  private
11
11
 
12
12
  def queues_cmd
13
- queues =
14
- if @strictly_ordered_queues
15
- @queues
16
- else
17
- permute = @queues.dup
18
- permute.shuffle!
19
- permute.uniq!
20
- permute
21
- end
22
-
23
- queues - Pauzer.paused_queues.map { |name| "queue:#{name}" }
13
+ super - Pauzer.paused_queues.map { |name| "queue:#{name}" }
24
14
  end
25
15
  end
26
16
  end
@@ -12,8 +12,7 @@ module Sidekiq
12
12
 
13
13
  # @param config [Config]
14
14
  def initialize(config)
15
- @mutex = Mutex.new
16
- @names = []
15
+ @names = Concurrent::Array.new
17
16
  @redis_key = config.redis_key
18
17
  @refresher = initialize_refresher(config.refresh_rate)
19
18
  end
@@ -21,7 +20,7 @@ module Sidekiq
21
20
  def each(&block)
22
21
  return to_enum __method__ unless block
23
22
 
24
- @mutex.synchronize { @names.dup }.each(&block)
23
+ @names.dup.each(&block)
25
24
 
26
25
  self
27
26
  end
@@ -71,17 +70,15 @@ module Sidekiq
71
70
  end
72
71
 
73
72
  def refresh
74
- @mutex.synchronize do
75
- names = Sidekiq.redis do |conn|
76
- # Cursor is not atomic, so there may be duplicates because of
77
- # concurrent update operations
78
- # See: https://redis.io/commands/scan/#scan-guarantees
79
- conn.sscan(@redis_key).to_a.uniq.each(&:freeze)
80
- end
81
-
82
- @names.replace(names)
73
+ names = Sidekiq.redis do |conn|
74
+ # Cursor is not atomic, so there may be duplicates because of
75
+ # concurrent update operations
76
+ # See: https://redis.io/commands/scan/#scan-guarantees
77
+ conn.sscan(@redis_key).to_a.uniq.each(&:freeze)
83
78
  end
84
79
 
80
+ @names.replace(names)
81
+
85
82
  self
86
83
  end
87
84
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Pauzer
5
- VERSION = "3.0.0"
5
+ VERSION = "3.1.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-pauzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Zapparov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-14 00:00:00.000000000 Z
11
+ date: 2023-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -62,9 +62,9 @@ licenses:
62
62
  - MIT
63
63
  metadata:
64
64
  homepage_uri: https://gitlab.com/ixti/sidekiq-pauzer
65
- source_code_uri: https://gitlab.com/ixti/sidekiq-pauzer/tree/v3.0.0
65
+ source_code_uri: https://gitlab.com/ixti/sidekiq-pauzer/tree/v3.1.0
66
66
  bug_tracker_uri: https://gitlab.com/ixti/sidekiq-pauzer/issues
67
- changelog_uri: https://gitlab.com/ixti/sidekiq-pauzer/blob/v3.0.0/CHANGES.md
67
+ changelog_uri: https://gitlab.com/ixti/sidekiq-pauzer/blob/v3.1.0/CHANGES.md
68
68
  rubygems_mfa_required: 'true'
69
69
  post_install_message:
70
70
  rdoc_options: []