sidekiq-pauzer 5.1.0 → 6.0.0

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
  SHA256:
3
- metadata.gz: c5f31ae5cfdfd5dd4e693e42c0bb82fbef4012cf9289772542f32131d996ecf7
4
- data.tar.gz: 9bf1d72ce135955e7887b0926df8b83e6e3333e2c86f7ba1f7070c1277a4c6fd
3
+ metadata.gz: 05b340fb4b830a876ed4918d692d1fe0e8853d6749e0bf6adf3a68cd040505c7
4
+ data.tar.gz: 32fc2b2569337b0831df884d59cff29778e5b40492f28ec7cf0c6c6d6b04782f
5
5
  SHA512:
6
- metadata.gz: 3c7d00653876ac75e9cf299ad49152d8818380de5c18e670f023dfa5ffa07c9dd2b2755a8cfab71a9cb37e7b7d46d4e119653b314425ef8ffb57c1ffaa87414c
7
- data.tar.gz: 89ab9cc7e4b0b90b4e3fa1b54b6a8e50577f52738faf0b96030edadc5fdddc1f6fd170b49aaf32be88a3538c31136404ee31576bf258ed2c7896584b189061cc
6
+ metadata.gz: 3c45cbb931597c2a5a0b07a313f78186fea626516e0f4d56e656d727962c0b5d46a09eee48018a5cb3d42329a8a591ae18eb901f3bafe9447a57fdc5b7d0f6f6
7
+ data.tar.gz: 1f252e840204e00288476ca8de71074550c9b5d054bf9767ae5b3c1f8bc1f02a86d97c360cb8bd2cbf3598f2df47ab43296ff9d67d9fd48e1ac6d186e017925f
data/README.adoc CHANGED
@@ -77,35 +77,35 @@ NOTE: If you are using custom Sidekiq views path, then you will need to call
77
77
  (after requiring `sidekiq/pauzer/web`): `Sidekiq::Pauzer::Web.unpatch_views!`.
78
78
 
79
79
 
80
- == Supported Ruby Versions
80
+ == Compatibility
81
81
 
82
- This library aims to support and is tested against the following Ruby versions:
82
+ This library aims to support and is tested against:
83
83
 
84
- * Ruby 3.0.x
85
- * Ruby 3.1.x
86
- * Ruby 3.2.x
84
+ * https://www.ruby-lang.org[Ruby]
85
+ ** MRI 3.2.x
86
+ ** MRI 3.3.x
87
+ ** MRI 3.4.x
88
+ * https://github.com/sidekiq/sidekiq[Sidekiq]
89
+ ** 8.0.0
90
+ * https://redis.io[Redis]
91
+ ** 7.0.x
92
+ ** 7.2.x
87
93
 
88
94
  If something doesn't work on one of these versions, it's a bug.
89
95
 
90
- This library may inadvertently work (or seem to work) on other Ruby versions,
91
- however support will only be provided for the versions listed above.
96
+ This library may inadvertently work (or seem to work) on other Ruby, Redis, and
97
+ Sidekiq versions, however support will only be provided for the versions listed
98
+ above.
92
99
 
93
- If you would like this library to support another Ruby version or
94
- implementation, you may volunteer to be a maintainer. Being a maintainer
95
- entails making sure all tests run and pass on that implementation. When
96
- something breaks on your implementation, you will be responsible for providing
97
- patches in a timely fashion. If critical issues for a particular implementation
98
- exist at the time of a major release, support for that Ruby version may be
100
+ If you would like this library to support another Ruby, Redis, or Sidekiq
101
+ version, you may volunteer to be a maintainer. Being a maintainer entails making
102
+ sure all tests run and pass on that implementation. When something breaks on
103
+ your implementation, you will be responsible for providing patches in a timely
104
+ fashion. If critical issues for a particular implementation exist at the time of
105
+ a major release, support for that Ruby, Redis, and/or Sidekiq version may be
99
106
  dropped.
100
107
 
101
108
 
102
- == Supported Sidekiq Versions
103
-
104
- This library aims to support and work with following Sidekiq versions:
105
-
106
- * Sidekiq 7.2.x
107
-
108
-
109
109
  == Development
110
110
 
111
111
  bundle install
@@ -17,7 +17,7 @@ module Sidekiq
17
17
  def apply!
18
18
  revert!
19
19
 
20
- Sidekiq::WebAction.class_eval <<-RUBY, __FILE__, __LINE__ + 1 # rubocop:disable Style/DocumentDynamicEvalDefinition
20
+ Sidekiq::Web::Action.class_eval <<-RUBY, __FILE__, __LINE__ + 1 # rubocop:disable Style/DocumentDynamicEvalDefinition
21
21
  def _erb_queues
22
22
  #{PAUZER_QUEUES_TEMPLATE}
23
23
  end
@@ -25,7 +25,7 @@ module Sidekiq
25
25
  end
26
26
 
27
27
  def revert!
28
- Sidekiq::WebAction.remove_method(:_erb_queues) if Sidekiq::WebAction.method_defined?(:_erb_queues)
28
+ Sidekiq::Web::Action.remove_method(:_erb_queues) if Sidekiq::Web::Action.method_defined?(:_erb_queues)
29
29
  end
30
30
  end
31
31
  end
@@ -17,20 +17,20 @@ module Sidekiq
17
17
  private
18
18
 
19
19
  def remove_theirs_queue_update_route
20
- Sidekiq::WebApplication
21
- .instance_variable_get(:@routes)
22
- .fetch(Sidekiq::WebRouter::POST)
20
+ Sidekiq::Web::Application
21
+ .route_cache
22
+ .fetch(:post)
23
23
  .delete_if { |route| route.pattern == "/queues/:name" }
24
24
  end
25
25
 
26
26
  def register_ours_queue_update_route # rubocop:disable Metrics/MethodLength
27
- Sidekiq::WebApplication.class_exec do
27
+ Sidekiq::Web::Application.class_exec do
28
28
  post "/queues/:name" do
29
- queue = Sidekiq::Queue.new(route_params[:name])
29
+ queue = Sidekiq::Queue.new(route_params(:name))
30
30
 
31
- if params["pause"]
31
+ if request.params["pause"]
32
32
  queue.pause!
33
- elsif params["unpause"]
33
+ elsif request.params["unpause"]
34
34
  queue.unpause!
35
35
  else
36
36
  queue.clear
@@ -14,9 +14,8 @@ module Sidekiq
14
14
  # @param refresh_rate [Float]
15
15
  # @param repository [Repository]
16
16
  def initialize(refresh_rate, repository:)
17
- @names = [].freeze
18
17
  @refresher = Concurrent::TimerTask.new(execution_interval: refresh_rate, run_now: true) do
19
- @names = repository.to_a.freeze
18
+ repository.to_a.freeze
20
19
  end
21
20
  end
22
21
 
@@ -31,7 +30,7 @@ module Sidekiq
31
30
  return to_enum __method__ unless block
32
31
 
33
32
  start_refresher unless refresher_running?
34
- @names.each(&block)
33
+ @refresher.value&.each(&block)
35
34
 
36
35
  self
37
36
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Pauzer
5
- VERSION = "5.1.0"
5
+ VERSION = "6.0.0"
6
6
  end
7
7
  end
data/web/views/queues.erb CHANGED
@@ -1,44 +1,46 @@
1
1
  <!-- sidekiq-pauzer <%= Sidekiq::Pauzer::VERSION %> -->
2
2
 
3
- <div class="header-container">
4
- <h1><%= t('Queues') %></h1>
5
- </div>
6
-
7
- <div class="table_container">
8
- <table class="queues table table-hover table-bordered table-striped">
9
- <thead>
10
- <th><%= t('Queue') %></th>
11
- <th><%= t('Size') %></th>
12
- <th><%= t('Latency') %></th>
13
- <th><%= t('Actions') %></th>
14
- </thead>
15
- <% @queues.each do |queue| %>
16
- <tr>
17
- <td>
18
- <a href="<%= root_path %>queues/<%= CGI.escape(queue.name) %>"><%= h queue.name %></a>
19
- <% if queue.paused? %>
20
- <span class="label label-danger"><%= t('Paused') %></span>
21
- <% end %>
22
- </td>
23
- <td class="num"><%= number_with_delimiter(queue.size) %> </td>
24
- <td class="num">
25
- <% queue_latency = queue.latency %>
26
- <%= (queue_latency < 60) ? '' : " (#{relative_time(Time.at(Time.now.to_f - queue_latency))})" %>
27
- <%= number_with_delimiter(queue_latency, precision: 2) %>
28
- </td>
29
- <td class="delete-confirm">
30
- <form action="<%=root_path %>queues/<%= CGI.escape(queue.name) %>" method="post">
31
- <%= csrf_tag %>
32
- <input class="btn btn-danger" type="submit" name="delete" title="This will delete all jobs within the queue, it will reappear if you push more jobs to it in the future." value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.name)) %>" />
3
+ <section>
4
+ <header>
5
+ <h1><%= t('Queues') %></h1>
6
+ </header>
33
7
 
8
+ <div class="table_container">
9
+ <table>
10
+ <thead>
11
+ <th><%= t('Queue') %></th>
12
+ <th><%= t('Size') %></th>
13
+ <th><%= t('Latency') %></th>
14
+ <th><%= t('Actions') %></th>
15
+ </thead>
16
+ <% @queues.each do |queue| %>
17
+ <tr>
18
+ <td>
19
+ <a href="<%= root_path %>queues/<%= CGI.escape(queue.name) %>"><%= h queue.name %></a>
34
20
  <% if queue.paused? %>
35
- <input class="btn btn-danger" type="submit" name="unpause" value="<%= t('Unpause') %>" />
36
- <% else %>
37
- <input class="btn btn-danger" type="submit" name="pause" value="<%= t('Pause') %>" />
21
+ <span class="label label-danger"><%= t('Paused') %></span>
38
22
  <% end %>
39
- </form>
40
- </td>
41
- </tr>
42
- <% end %>
43
- </table>
44
- </div>
23
+ </td>
24
+ <td class="num"><%= number_with_delimiter(queue.size) %> </td>
25
+ <td class="num">
26
+ <% queue_latency = queue.latency %>
27
+ <%= (queue_latency < 60) ? '' : " (#{relative_time(Time.at(Time.now.to_f - queue_latency))})" %>
28
+ <%= number_with_delimiter(queue_latency, precision: 2) %>
29
+ </td>
30
+ <td class="delete-confirm">
31
+ <form action="<%=root_path %>queues/<%= CGI.escape(queue.name) %>" method="post">
32
+ <%= csrf_tag %>
33
+ <input class="btn btn-danger" type="submit" name="delete" title="This will delete all jobs within the queue, it will reappear if you push more jobs to it in the future." value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.name)) %>" />
34
+
35
+ <% if queue.paused? %>
36
+ <input class="btn btn-danger" type="submit" name="unpause" value="<%= t('Unpause') %>" />
37
+ <% else %>
38
+ <input class="btn btn-danger" type="submit" name="pause" value="<%= t('Pause') %>" />
39
+ <% end %>
40
+ </form>
41
+ </td>
42
+ </tr>
43
+ <% end %>
44
+ </table>
45
+ </div>
46
+ </section>
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: 5.1.0
4
+ version: 6.0.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-12-10 00:00:00.000000000 Z
11
+ date: 2025-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '7.2'
33
+ version: '8.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '7.2'
40
+ version: '8.0'
41
41
  description:
42
42
  email:
43
43
  - alexey@zapparov.com
@@ -64,9 +64,9 @@ licenses:
64
64
  - MIT
65
65
  metadata:
66
66
  homepage_uri: https://github.com/ixti/sidekiq-pauzer
67
- source_code_uri: https://github.com/ixti/sidekiq-pauzer/tree/v5.1.0
67
+ source_code_uri: https://github.com/ixti/sidekiq-pauzer/tree/v6.0.0
68
68
  bug_tracker_uri: https://github.com/ixti/sidekiq-pauzer/issues
69
- changelog_uri: https://github.com/ixti/sidekiq-pauzer/blob/v5.1.0/CHANGES.md
69
+ changelog_uri: https://github.com/ixti/sidekiq-pauzer/blob/v6.0.0/CHANGES.md
70
70
  rubygems_mfa_required: 'true'
71
71
  post_install_message:
72
72
  rdoc_options: []
@@ -76,14 +76,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
76
  requirements:
77
77
  - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: '3.0'
79
+ version: '3.2'
80
80
  required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - ">="
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubygems_version: 3.4.10
86
+ rubygems_version: 3.4.19
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: Enhance Sidekiq with queue pausing