sidekiq-belt 0.3.7 → 1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edb3a875c6a19a21d87d63f32b116f44fdba5c55dcb62577a94e6b1727449d0b
|
4
|
+
data.tar.gz: de58057b262d16db28fd45ff42f888361e9692158d1c906ffa3566dc38081c01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25897766813a45a51454e7b43a4737e9acb223d2e89490f657a02afe90f295e9edff9b240021ab8e3aaa978064bbde966d4713ed1c1385c5d4274f51c4cce64c
|
7
|
+
data.tar.gz: 1da39ce3c83f28daac2f8c1b598ac8c7c8c587e6d6dfb08ba3258deceacc96b65772cdde00ca9eb3440fc486a298f9e62152b9d67e5716f0f746a63ea25337ed
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require "sidekiq"
|
4
4
|
|
5
5
|
require_relative "failed_batch_remove"
|
6
|
+
require_relative "force_batch_callback"
|
6
7
|
|
7
8
|
module Sidekiq
|
8
9
|
module Belt
|
@@ -14,6 +15,7 @@ module Sidekiq
|
|
14
15
|
all = options.include?(:all)
|
15
16
|
|
16
17
|
Sidekiq::Belt::Pro::FailedBatchRemove.use! if all || options.include?(:failed_batch_remove)
|
18
|
+
Sidekiq::Belt::Pro::ForceBatchCallback.use! if all || options.include?(:force_batch_callback)
|
17
19
|
|
18
20
|
true
|
19
21
|
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "sidekiq/web/helpers"
|
4
|
+
|
5
|
+
module Sidekiq
|
6
|
+
module Belt
|
7
|
+
module Pro
|
8
|
+
module ForceBatchCallback
|
9
|
+
module SidekiqForceBatchCallback
|
10
|
+
def self.action_button(action)
|
11
|
+
<<~ERB
|
12
|
+
<form action="<%= root_path %>batches/<%= @batch.bid %>/force_callback/#{action}" method="post">
|
13
|
+
<%= csrf_tag %>
|
14
|
+
<input class="btn btn-danger" type="submit" name="force_#{action}" value="<%= t('#{action.capitalize}') %>"
|
15
|
+
data-confirm="Do you want to force the #{action} callback for batch <%= @batch.bid %>? <%= t('AreYouSure') %>" />
|
16
|
+
</form>
|
17
|
+
ERB
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.registered(app)
|
21
|
+
app.replace_content("/batches/:bid") do |content|
|
22
|
+
content.sub!(%r{(</tbody>)}) do |match|
|
23
|
+
<<-HTML
|
24
|
+
<tr>
|
25
|
+
<th><%= t("Force Action") %></th>
|
26
|
+
<td>
|
27
|
+
<div style="display: flex;">
|
28
|
+
#{action_button("success")}
|
29
|
+
#{action_button("complete")}
|
30
|
+
#{action_button("death")}
|
31
|
+
</div>
|
32
|
+
</td>
|
33
|
+
</tr>
|
34
|
+
#{match}
|
35
|
+
HTML
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
app.post("/batches/:bid/force_callback/:action") do
|
40
|
+
Sidekiq::Batch::Callback.perform_inline(params[:action], params[:bid])
|
41
|
+
|
42
|
+
return redirect "#{root_path}batches"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.use!
|
48
|
+
require("sidekiq/web")
|
49
|
+
|
50
|
+
Sidekiq::Web.register(Sidekiq::Belt::Pro::ForceBatchCallback::SidekiqForceBatchCallback)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/lib/sidekiq/belt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-belt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danilo Jeremias da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- lib/sidekiq/belt/ent/periodic_sort.rb
|
53
53
|
- lib/sidekiq/belt/pro/failed_batch_remove.rb
|
54
54
|
- lib/sidekiq/belt/pro/files.rb
|
55
|
+
- lib/sidekiq/belt/pro/force_batch_callback.rb
|
55
56
|
- lib/sidekiq/belt/version.rb
|
56
57
|
- lib/sidekiq/web_action_helper.rb
|
57
58
|
- lib/sidekiq/web_router_helper.rb
|
@@ -78,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
79
|
- !ruby/object:Gem::Version
|
79
80
|
version: '0'
|
80
81
|
requirements: []
|
81
|
-
rubygems_version: 3.5.
|
82
|
+
rubygems_version: 3.5.23
|
82
83
|
signing_key:
|
83
84
|
specification_version: 4
|
84
85
|
summary: This Ruby gem enhances the capabilities of Sidekiq, Sidekiq Pro, and Sidekiq
|