sidekiq-pauzer 1.1.0 → 2.2.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: b31cb662c56453b04bebf1a887af9515aa0d86a74f9c9e0c6bb79513c499ed7e
4
- data.tar.gz: c57e7667afcabea723ffdb57f5ae38f53ab756c22f2952bb1344d660df806bd4
3
+ metadata.gz: b7181876b443f54e7ce377358fc1dc9920bf6aff98973aa5d1499e1b2a56401a
4
+ data.tar.gz: ee6a16525e36c8c4ba468817be43298cfd5905760e5fb737e6a743ec1577b0fc
5
5
  SHA512:
6
- metadata.gz: 5456887979763bf5c4c741fa2dec95c4454222f77d65f212f4472a68dd248880a7b18687a6df999d9c6c25291d01027c01c4fed4630948d579cd9f2174f8635e
7
- data.tar.gz: af94a161c39ff35abd29aa35a110c69d25144fd7b3d54b63bae65c64053694813e1eb7a8741e35182342b9e3c9b8de041290e8f46ffc3da6e34b6f489988365b
6
+ metadata.gz: 27c52a1aa9e02ad2dbb48ea2be6af3458e11798974d963e03a0f7edb729d8fc6dd09ab56f259be8006da5bc9a1cf51e9e87cb8e7b35c6f2f9174d381d76d4d29
7
+ data.tar.gz: fb4f9043119f8c26b1be9aa5d6aed8cdd14640a7a6b630607bb3694ec0e0f1ccad8e8e3a802a57949c70cafd45e0375bfed99138badd303daa217d1bdc4da97c
@@ -42,7 +42,7 @@ module Sidekiq
42
42
  end
43
43
 
44
44
  def excluding_paused(queues)
45
- queues - Pauzer.paused_queue_names.map { |name| "queue:#{name}" }
45
+ queues - Pauzer.paused_queues.map { |name| "queue:#{name}" }
46
46
  end
47
47
  end
48
48
  end
@@ -14,8 +14,7 @@ module Sidekiq
14
14
 
15
15
  # @param config [Config]
16
16
  def initialize(config)
17
- @mutex = Mutex.new
18
- @names = []
17
+ @names = Concurrent::Array.new
19
18
  @redis_key = config.redis_key
20
19
  @refresher = initialize_refresher(config.refresh_rate)
21
20
  end
@@ -23,7 +22,7 @@ module Sidekiq
23
22
  def each(&block)
24
23
  return to_enum __method__ unless block
25
24
 
26
- @mutex.synchronize { @names.dup }.each(&block)
25
+ @names.dup.each(&block)
27
26
 
28
27
  self
29
28
  end
@@ -73,11 +72,7 @@ module Sidekiq
73
72
  end
74
73
 
75
74
  def refresh
76
- @mutex.synchronize do
77
- names = Sidekiq.redis { |conn| Adapters[conn].list(conn, @redis_key) }
78
-
79
- @names.replace(names)
80
- end
75
+ @names.replace(Sidekiq.redis { |conn| Adapters[conn].list(conn, @redis_key) })
81
76
 
82
77
  self
83
78
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Pauzer
5
- VERSION = "1.1.0"
5
+ VERSION = "2.2.0"
6
6
  end
7
7
  end
@@ -78,24 +78,15 @@ module Sidekiq
78
78
 
79
79
  # @example
80
80
  # Sidekiq::Pauzer.pause!("minor")
81
- # Sidekiq::Pauzer.paused_queue_names # => ["minor"]
81
+ # Sidekiq::Pauzer.paused_queues # => ["minor"]
82
82
  #
83
83
  # @return [Array<String>]
84
- def paused_queue_names
84
+ def paused_queues
85
85
  @queues.to_a
86
86
  end
87
87
 
88
- # @deprecated Use {.paused_queue_names} instead.
89
- # Will be removed in ‹2.0.0›.
90
- #
91
- # @example
92
- # Sidekiq::Pauzer.pause!("minor")
93
- # Sidekiq::Pauzer.paused_queues # => ["queue:minor"]
94
- #
95
- # @return [Array<String>]
96
- def paused_queues
97
- @queues.map { |name| "queue:#{name}" }
98
- end
88
+ # @deprecated Use {.paused_queues}
89
+ alias paused_queue_names paused_queues
99
90
 
100
91
  # Yields `config` for a block.
101
92
  #
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: 1.1.0
4
+ version: 2.2.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-12 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
@@ -66,9 +66,9 @@ licenses:
66
66
  - MIT
67
67
  metadata:
68
68
  homepage_uri: https://gitlab.com/ixti/sidekiq-pauzer
69
- source_code_uri: https://gitlab.com/ixti/sidekiq-pauzer/tree/v1.1.0
69
+ source_code_uri: https://gitlab.com/ixti/sidekiq-pauzer/tree/v2.2.0
70
70
  bug_tracker_uri: https://gitlab.com/ixti/sidekiq-pauzer/issues
71
- changelog_uri: https://gitlab.com/ixti/sidekiq-pauzer/blob/v1.1.0/CHANGES.md
71
+ changelog_uri: https://gitlab.com/ixti/sidekiq-pauzer/blob/v2.2.0/CHANGES.md
72
72
  rubygems_mfa_required: 'true'
73
73
  post_install_message:
74
74
  rdoc_options: []