sidekiq-web_custom 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +123 -112
- data/lib/sidekiq/web_custom/processor.rb +17 -16
- data/lib/sidekiq/web_custom/version.rb +2 -2
- data/lib/sidekiq/web_custom.rb +1 -6
- data/sidekiq-web_custom.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 815bd23151114eb4c72a9f191c8038a394a8f3dd50b8209eb11cd1df03a70246
|
4
|
+
data.tar.gz: 3be935aeb2523cbe18febb5f1e173bb4b5fe8c1e9cad07f1a2338d4a81010e0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3f0257f49ef4d2170e50923489f70404d792ede869b3298f415b3c9d56f32edb5d9564adb2c50ab9e319598752f19a1515531901f8f357754111ea23a042887
|
7
|
+
data.tar.gz: dceab9cddad2591ddc1d9ba657c0958443684616557bd0c51653996369c415ba7911119bf9a20a7f5d9f7a8e8a85145654eba59a5e6920fc5c1f4e3f17f0364c
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -2,182 +2,193 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
sidekiq-web_custom (0.4.1)
|
5
|
-
sidekiq (~> 6.
|
5
|
+
sidekiq (~> 6.5)
|
6
6
|
timeoutable (>= 1.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (
|
12
|
-
actionpack (=
|
13
|
-
activesupport (=
|
11
|
+
actioncable (7.0.3.1)
|
12
|
+
actionpack (= 7.0.3.1)
|
13
|
+
activesupport (= 7.0.3.1)
|
14
14
|
nio4r (~> 2.0)
|
15
15
|
websocket-driver (>= 0.6.1)
|
16
|
-
actionmailbox (
|
17
|
-
actionpack (=
|
18
|
-
activejob (=
|
19
|
-
activerecord (=
|
20
|
-
activestorage (=
|
21
|
-
activesupport (=
|
16
|
+
actionmailbox (7.0.3.1)
|
17
|
+
actionpack (= 7.0.3.1)
|
18
|
+
activejob (= 7.0.3.1)
|
19
|
+
activerecord (= 7.0.3.1)
|
20
|
+
activestorage (= 7.0.3.1)
|
21
|
+
activesupport (= 7.0.3.1)
|
22
22
|
mail (>= 2.7.1)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
net-imap
|
24
|
+
net-pop
|
25
|
+
net-smtp
|
26
|
+
actionmailer (7.0.3.1)
|
27
|
+
actionpack (= 7.0.3.1)
|
28
|
+
actionview (= 7.0.3.1)
|
29
|
+
activejob (= 7.0.3.1)
|
30
|
+
activesupport (= 7.0.3.1)
|
28
31
|
mail (~> 2.5, >= 2.5.4)
|
32
|
+
net-imap
|
33
|
+
net-pop
|
34
|
+
net-smtp
|
29
35
|
rails-dom-testing (~> 2.0)
|
30
|
-
actionpack (
|
31
|
-
actionview (=
|
32
|
-
activesupport (=
|
33
|
-
rack (~> 2.0, >= 2.0
|
36
|
+
actionpack (7.0.3.1)
|
37
|
+
actionview (= 7.0.3.1)
|
38
|
+
activesupport (= 7.0.3.1)
|
39
|
+
rack (~> 2.0, >= 2.2.0)
|
34
40
|
rack-test (>= 0.6.3)
|
35
41
|
rails-dom-testing (~> 2.0)
|
36
42
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
37
|
-
actiontext (
|
38
|
-
actionpack (=
|
39
|
-
activerecord (=
|
40
|
-
activestorage (=
|
41
|
-
activesupport (=
|
43
|
+
actiontext (7.0.3.1)
|
44
|
+
actionpack (= 7.0.3.1)
|
45
|
+
activerecord (= 7.0.3.1)
|
46
|
+
activestorage (= 7.0.3.1)
|
47
|
+
activesupport (= 7.0.3.1)
|
48
|
+
globalid (>= 0.6.0)
|
42
49
|
nokogiri (>= 1.8.5)
|
43
|
-
actionview (
|
44
|
-
activesupport (=
|
50
|
+
actionview (7.0.3.1)
|
51
|
+
activesupport (= 7.0.3.1)
|
45
52
|
builder (~> 3.1)
|
46
53
|
erubi (~> 1.4)
|
47
54
|
rails-dom-testing (~> 2.0)
|
48
55
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
49
|
-
activejob (
|
50
|
-
activesupport (=
|
56
|
+
activejob (7.0.3.1)
|
57
|
+
activesupport (= 7.0.3.1)
|
51
58
|
globalid (>= 0.3.6)
|
52
|
-
activemodel (
|
53
|
-
activesupport (=
|
54
|
-
activerecord (
|
55
|
-
activemodel (=
|
56
|
-
activesupport (=
|
57
|
-
activestorage (
|
58
|
-
actionpack (=
|
59
|
-
activejob (=
|
60
|
-
activerecord (=
|
61
|
-
activesupport (=
|
62
|
-
marcel (~> 1.0
|
63
|
-
mini_mime (
|
64
|
-
activesupport (
|
59
|
+
activemodel (7.0.3.1)
|
60
|
+
activesupport (= 7.0.3.1)
|
61
|
+
activerecord (7.0.3.1)
|
62
|
+
activemodel (= 7.0.3.1)
|
63
|
+
activesupport (= 7.0.3.1)
|
64
|
+
activestorage (7.0.3.1)
|
65
|
+
actionpack (= 7.0.3.1)
|
66
|
+
activejob (= 7.0.3.1)
|
67
|
+
activerecord (= 7.0.3.1)
|
68
|
+
activesupport (= 7.0.3.1)
|
69
|
+
marcel (~> 1.0)
|
70
|
+
mini_mime (>= 1.1.0)
|
71
|
+
activesupport (7.0.3.1)
|
65
72
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
66
73
|
i18n (>= 1.6, < 2)
|
67
74
|
minitest (>= 5.1)
|
68
75
|
tzinfo (~> 2.0)
|
69
|
-
zeitwerk (~> 2.3)
|
70
76
|
builder (3.2.4)
|
71
|
-
byebug (11.1.3)
|
72
77
|
coderay (1.1.3)
|
73
|
-
concurrent-ruby (1.1.
|
78
|
+
concurrent-ruby (1.1.10)
|
74
79
|
connection_pool (2.2.5)
|
75
80
|
crass (1.0.6)
|
76
|
-
diff-lcs (1.
|
81
|
+
diff-lcs (1.5.0)
|
82
|
+
digest (3.1.0)
|
77
83
|
docile (1.4.0)
|
78
|
-
erubi (1.
|
79
|
-
globalid (0.
|
80
|
-
activesupport (>=
|
81
|
-
i18n (1.
|
84
|
+
erubi (1.11.0)
|
85
|
+
globalid (1.0.0)
|
86
|
+
activesupport (>= 5.0)
|
87
|
+
i18n (1.12.0)
|
82
88
|
concurrent-ruby (~> 1.0)
|
83
|
-
loofah (2.
|
89
|
+
loofah (2.18.0)
|
84
90
|
crass (~> 1.0.2)
|
85
91
|
nokogiri (>= 1.5.9)
|
86
92
|
mail (2.7.1)
|
87
93
|
mini_mime (>= 0.1.1)
|
88
|
-
marcel (1.0.
|
94
|
+
marcel (1.0.2)
|
89
95
|
method_source (1.0.0)
|
90
|
-
mini_mime (1.
|
91
|
-
minitest (5.
|
92
|
-
|
93
|
-
|
96
|
+
mini_mime (1.1.2)
|
97
|
+
minitest (5.16.3)
|
98
|
+
net-imap (0.2.3)
|
99
|
+
digest
|
100
|
+
net-protocol
|
101
|
+
strscan
|
102
|
+
net-pop (0.1.1)
|
103
|
+
digest
|
104
|
+
net-protocol
|
105
|
+
timeout
|
106
|
+
net-protocol (0.1.3)
|
107
|
+
timeout
|
108
|
+
net-smtp (0.3.1)
|
109
|
+
digest
|
110
|
+
net-protocol
|
111
|
+
timeout
|
112
|
+
nio4r (2.5.8)
|
113
|
+
nokogiri (1.13.8-x86_64-linux)
|
94
114
|
racc (~> 1.4)
|
95
|
-
pry (0.
|
115
|
+
pry (0.14.1)
|
96
116
|
coderay (~> 1.1)
|
97
117
|
method_source (~> 1.0)
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
activerecord (= 6.1.3.2)
|
115
|
-
activestorage (= 6.1.3.2)
|
116
|
-
activesupport (= 6.1.3.2)
|
118
|
+
racc (1.6.0)
|
119
|
+
rack (2.2.4)
|
120
|
+
rack-test (2.0.2)
|
121
|
+
rack (>= 1.3)
|
122
|
+
rails (7.0.3.1)
|
123
|
+
actioncable (= 7.0.3.1)
|
124
|
+
actionmailbox (= 7.0.3.1)
|
125
|
+
actionmailer (= 7.0.3.1)
|
126
|
+
actionpack (= 7.0.3.1)
|
127
|
+
actiontext (= 7.0.3.1)
|
128
|
+
actionview (= 7.0.3.1)
|
129
|
+
activejob (= 7.0.3.1)
|
130
|
+
activemodel (= 7.0.3.1)
|
131
|
+
activerecord (= 7.0.3.1)
|
132
|
+
activestorage (= 7.0.3.1)
|
133
|
+
activesupport (= 7.0.3.1)
|
117
134
|
bundler (>= 1.15.0)
|
118
|
-
railties (=
|
119
|
-
sprockets-rails (>= 2.0.0)
|
135
|
+
railties (= 7.0.3.1)
|
120
136
|
rails-dom-testing (2.0.3)
|
121
137
|
activesupport (>= 4.2.0)
|
122
138
|
nokogiri (>= 1.6)
|
123
|
-
rails-html-sanitizer (1.3
|
139
|
+
rails-html-sanitizer (1.4.3)
|
124
140
|
loofah (~> 2.3)
|
125
|
-
railties (
|
126
|
-
actionpack (=
|
127
|
-
activesupport (=
|
141
|
+
railties (7.0.3.1)
|
142
|
+
actionpack (= 7.0.3.1)
|
143
|
+
activesupport (= 7.0.3.1)
|
128
144
|
method_source
|
129
|
-
rake (>=
|
145
|
+
rake (>= 12.2)
|
130
146
|
thor (~> 1.0)
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
rspec-
|
136
|
-
rspec-
|
137
|
-
|
138
|
-
|
139
|
-
|
147
|
+
zeitwerk (~> 2.5)
|
148
|
+
rake (13.0.6)
|
149
|
+
redis (4.7.1)
|
150
|
+
rspec (3.11.0)
|
151
|
+
rspec-core (~> 3.11.0)
|
152
|
+
rspec-expectations (~> 3.11.0)
|
153
|
+
rspec-mocks (~> 3.11.0)
|
154
|
+
rspec-core (3.11.0)
|
155
|
+
rspec-support (~> 3.11.0)
|
156
|
+
rspec-expectations (3.11.0)
|
140
157
|
diff-lcs (>= 1.2.0, < 2.0)
|
141
|
-
rspec-support (~> 3.
|
142
|
-
rspec-mocks (3.
|
158
|
+
rspec-support (~> 3.11.0)
|
159
|
+
rspec-mocks (3.11.1)
|
143
160
|
diff-lcs (>= 1.2.0, < 2.0)
|
144
|
-
rspec-support (~> 3.
|
145
|
-
rspec-support (3.
|
146
|
-
rspec_junit_formatter (0.
|
161
|
+
rspec-support (~> 3.11.0)
|
162
|
+
rspec-support (3.11.0)
|
163
|
+
rspec_junit_formatter (0.5.1)
|
147
164
|
rspec-core (>= 2, < 4, != 2.12.0)
|
148
|
-
sidekiq (6.4
|
165
|
+
sidekiq (6.5.4)
|
149
166
|
connection_pool (>= 2.2.2)
|
150
167
|
rack (~> 2.0)
|
151
|
-
redis (>= 4.
|
168
|
+
redis (>= 4.5.0)
|
152
169
|
simplecov (0.21.2)
|
153
170
|
docile (~> 1.1)
|
154
171
|
simplecov-html (~> 0.11)
|
155
172
|
simplecov_json_formatter (~> 0.1)
|
156
173
|
simplecov-html (0.12.3)
|
157
|
-
simplecov_json_formatter (0.1.
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
sprockets-rails (3.2.2)
|
162
|
-
actionpack (>= 4.0)
|
163
|
-
activesupport (>= 4.0)
|
164
|
-
sprockets (>= 3.0.0)
|
165
|
-
thor (1.1.0)
|
166
|
-
timeout (0.2.0)
|
174
|
+
simplecov_json_formatter (0.1.4)
|
175
|
+
strscan (3.0.4)
|
176
|
+
thor (1.2.1)
|
177
|
+
timeout (0.3.0)
|
167
178
|
timeoutable (1.1.1)
|
168
179
|
timeout
|
169
|
-
tzinfo (2.0.
|
180
|
+
tzinfo (2.0.5)
|
170
181
|
concurrent-ruby (~> 1.0)
|
171
182
|
websocket-driver (0.7.5)
|
172
183
|
websocket-extensions (>= 0.1.0)
|
173
184
|
websocket-extensions (0.1.5)
|
174
|
-
zeitwerk (2.
|
185
|
+
zeitwerk (2.6.0)
|
175
186
|
|
176
187
|
PLATFORMS
|
177
188
|
x86_64-linux
|
178
189
|
|
179
190
|
DEPENDENCIES
|
180
|
-
pry
|
191
|
+
pry
|
181
192
|
rails
|
182
193
|
rake (~> 13.0)
|
183
194
|
rspec (~> 3.0)
|
@@ -186,4 +197,4 @@ DEPENDENCIES
|
|
186
197
|
simplecov
|
187
198
|
|
188
199
|
BUNDLED WITH
|
189
|
-
2.
|
200
|
+
2.3.20
|
@@ -4,49 +4,50 @@ module Sidekiq
|
|
4
4
|
module WebCustom
|
5
5
|
class Processor < ::Sidekiq::Processor
|
6
6
|
|
7
|
-
def self.execute(max:, queue:, options: Sidekiq
|
7
|
+
def self.execute(max:, queue:, options: Sidekiq)
|
8
8
|
__processor__(queue: queue, options: options).__execute(max: max)
|
9
9
|
end
|
10
10
|
|
11
|
-
def self.execute_job(job:, options: Sidekiq
|
11
|
+
def self.execute_job(job:, options: Sidekiq)
|
12
12
|
__processor__(queue: job.queue, options: options).__execute_job(job: job)
|
13
13
|
rescue StandardError => _
|
14
14
|
false # error gets loggged downstream
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.__processor__(queue:, options: Sidekiq
|
18
|
-
options_temp = options.
|
17
|
+
def self.__processor__(queue:, options: Sidekiq)
|
18
|
+
options_temp = options.dup
|
19
19
|
queue = queue.is_a?(String) ? Sidekiq::Queue.new(queue) : queue
|
20
20
|
|
21
21
|
options_temp[:queues] = [queue.name]
|
22
22
|
klass = options_temp[:fetch]&.class || BasicFetch
|
23
23
|
options_temp[:fetch] = klass.new(options_temp)
|
24
|
-
|
24
|
+
|
25
|
+
new(options: options_temp, queue: queue)
|
25
26
|
end
|
26
27
|
|
27
|
-
def initialize(
|
28
|
+
def initialize(options:, queue:)
|
28
29
|
@__queue = queue
|
29
30
|
@__basic_fetch = options[:fetch].class == BasicFetch
|
30
31
|
|
31
|
-
super(
|
32
|
+
super(options)
|
32
33
|
end
|
33
34
|
|
34
35
|
def __execute_job(job:)
|
35
36
|
queue_name = "queue:#{job.queue}"
|
36
37
|
work_unit = Sidekiq::BasicFetch::UnitOfWork.new(queue_name, job.item.to_json)
|
37
38
|
begin
|
38
|
-
|
39
|
+
logger.info "Manually processing individual work unit for #{work_unit.queue_name}"
|
39
40
|
process(work_unit)
|
40
41
|
rescue StandardError => e
|
41
|
-
|
42
|
+
logger.error "Manually processed work unit failed with #{e.message}. Work unit will not be dequeued"
|
42
43
|
raise e
|
43
44
|
end
|
44
45
|
|
45
46
|
begin
|
46
47
|
job.delete
|
47
|
-
|
48
|
+
logger.info { "Manually processed work unit sucessfully dequeued." }
|
48
49
|
rescue StandardError => e
|
49
|
-
|
50
|
+
logger.fatal "Manually processed work unit failed to be dequeued. #{e.message}."
|
50
51
|
raise e
|
51
52
|
end
|
52
53
|
|
@@ -59,21 +60,21 @@ module Sidekiq
|
|
59
60
|
break if @__queue.size <= 0
|
60
61
|
|
61
62
|
if Thread.current[Sidekiq::WebCustom::BREAK_BIT]
|
62
|
-
|
63
|
+
logger.warn "Yikes -- Break bit has been set. Attempting to return in time. Completed #{count} of attempted #{max}"
|
63
64
|
break
|
64
65
|
end
|
65
66
|
|
66
|
-
|
67
|
+
logger.info { "Manually processing next item in queue:[#{@__queue.name}]" }
|
67
68
|
process_one
|
68
69
|
count += 1
|
69
|
-
|
70
70
|
end
|
71
|
+
|
71
72
|
count
|
72
73
|
rescue Exception => ex
|
73
74
|
if @job && @__basic_fetch
|
74
|
-
|
75
|
+
logger.fatal "Processor Execution interrupted. Lost Job #{@job.job}"
|
75
76
|
end
|
76
|
-
|
77
|
+
logger.warn "Manual execution has terminated. Received error [#{ex.message}]"
|
77
78
|
return count
|
78
79
|
end
|
79
80
|
end
|
@@ -3,8 +3,8 @@
|
|
3
3
|
module Sidekiq
|
4
4
|
module WebCustom
|
5
5
|
MAJOR = 0 # With backwards incompatability. Requires annoucment and update documentation
|
6
|
-
MINOR =
|
7
|
-
PATCH =
|
6
|
+
MINOR = 5 # With feature launch. Documentation of upgrade is useful via a changelog
|
7
|
+
PATCH = 0 # With minor upgrades or patcing a small bug. No changelog necessary
|
8
8
|
VERSION = [MAJOR,MINOR,PATCH].join('.')
|
9
9
|
|
10
10
|
def self.get_version
|
data/lib/sidekiq/web_custom.rb
CHANGED
@@ -84,12 +84,7 @@ module Sidekiq
|
|
84
84
|
@__already_called = true
|
85
85
|
::Sidekiq::WebAction.prepend WebAction
|
86
86
|
::Sidekiq::Queue.prepend Queue
|
87
|
-
|
88
|
-
if ::Sidekiq::VERSION >= "6.4.0"
|
89
|
-
::Sidekiq::JobRecord.prepend Job
|
90
|
-
else
|
91
|
-
::Sidekiq::Job.prepend Job
|
92
|
-
end
|
87
|
+
::Sidekiq::JobRecord.prepend Job
|
93
88
|
|
94
89
|
::Sidekiq::Web.register WebApp
|
95
90
|
end
|
data/sidekiq-web_custom.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
DOC
|
17
17
|
spec.homepage = "https://github.com/matt-taylor/sidekiq-web_custom"
|
18
18
|
spec.license = "MIT"
|
19
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
19
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7")
|
20
20
|
|
21
21
|
# spec.metadata["allowed_push_host"] = "Set to 'http://mygemserver.com'"
|
22
22
|
|
@@ -33,6 +33,6 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
34
34
|
spec.require_paths = ["lib"]
|
35
35
|
|
36
|
-
spec.add_dependency 'sidekiq', '~> 6.
|
36
|
+
spec.add_dependency 'sidekiq', '~> 6.5'
|
37
37
|
spec.add_dependency 'timeoutable', '>= 1.0'
|
38
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-web_custom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '6.
|
19
|
+
version: '6.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '6.
|
26
|
+
version: '6.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: timeoutable
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,14 +139,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
139
139
|
requirements:
|
140
140
|
- - ">="
|
141
141
|
- !ruby/object:Gem::Version
|
142
|
-
version: 2.
|
142
|
+
version: '2.7'
|
143
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
145
|
- - ">="
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.3.11
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: This gem adds on custom capabilities to the Sidekiq Web UI
|