sidekiq-web_custom 0.4.1 → 0.6.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: 4b843dd9ee6f1e39c88bea10dacd981c943cce580ae2f8fefa699cc4f98a148c
4
- data.tar.gz: 822d7ddf7bdff16b66ea2d0259355d98e9abb140e33d89043f2b3fb04aa8de50
3
+ metadata.gz: 427d9471114bcf5d95d6fb58e9311be0f64cdea22509f9c221a0723b15576d6d
4
+ data.tar.gz: ec73717a0c1e8e99d0a4dde681d3d864c665702d5a434f47670a48fd7ccc945b
5
5
  SHA512:
6
- metadata.gz: 440af8e263e8e989282afa19601b296c11eb370304b37d4e8089c912c9990aae485412627e353132daa772090fc43c2ba62d2a377f8c8cfa265d9b3d31d97a49
7
- data.tar.gz: 639231fad41d053fc900801985b1650c37c94eb0128e3b72a8825f1ef3c6e3092fabc2b2809f11db453c28e413e6ffbbfbbc7e31c2d0168dc14c8cb3f01c66da
6
+ metadata.gz: 0ef0e033694e373a458fb18b022406efde9e36c518d657a3b3dfc7965fc3ba15f53fd1dbc3414b87c09448227e66a1ec4d235a5602f5ff143381a2f6b04010b7
7
+ data.tar.gz: 47fca45fecccb9d523eeef11946d3c403d79d4c7a1f8b01a3495d7b8f5ba9edde68a3277e39c7983d301a84acfae761ea332b3d300bfa7a30eeed8a6227e4cdd
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gemspec
7
7
 
8
8
 
9
9
  gem 'rails'
10
- gem 'pry-byebug'
10
+ gem 'pry'
11
11
  gem "rake", "~> 13.0"
12
12
  gem "rspec", "~> 3.0"
13
13
  gem 'rspec_junit_formatter'
data/Gemfile.lock CHANGED
@@ -1,183 +1,196 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sidekiq-web_custom (0.4.1)
5
- sidekiq (~> 6.0)
4
+ sidekiq-web_custom (0.6.0)
5
+ sidekiq (~> 7)
6
6
  timeoutable (>= 1.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (6.1.3.2)
12
- actionpack (= 6.1.3.2)
13
- activesupport (= 6.1.3.2)
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 (6.1.3.2)
17
- actionpack (= 6.1.3.2)
18
- activejob (= 6.1.3.2)
19
- activerecord (= 6.1.3.2)
20
- activestorage (= 6.1.3.2)
21
- activesupport (= 6.1.3.2)
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
- actionmailer (6.1.3.2)
24
- actionpack (= 6.1.3.2)
25
- actionview (= 6.1.3.2)
26
- activejob (= 6.1.3.2)
27
- activesupport (= 6.1.3.2)
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 (6.1.3.2)
31
- actionview (= 6.1.3.2)
32
- activesupport (= 6.1.3.2)
33
- rack (~> 2.0, >= 2.0.9)
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 (6.1.3.2)
38
- actionpack (= 6.1.3.2)
39
- activerecord (= 6.1.3.2)
40
- activestorage (= 6.1.3.2)
41
- activesupport (= 6.1.3.2)
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 (6.1.3.2)
44
- activesupport (= 6.1.3.2)
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 (6.1.3.2)
50
- activesupport (= 6.1.3.2)
56
+ activejob (7.0.3.1)
57
+ activesupport (= 7.0.3.1)
51
58
  globalid (>= 0.3.6)
52
- activemodel (6.1.3.2)
53
- activesupport (= 6.1.3.2)
54
- activerecord (6.1.3.2)
55
- activemodel (= 6.1.3.2)
56
- activesupport (= 6.1.3.2)
57
- activestorage (6.1.3.2)
58
- actionpack (= 6.1.3.2)
59
- activejob (= 6.1.3.2)
60
- activerecord (= 6.1.3.2)
61
- activesupport (= 6.1.3.2)
62
- marcel (~> 1.0.0)
63
- mini_mime (~> 1.0.2)
64
- activesupport (6.1.3.2)
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.9)
74
- connection_pool (2.2.5)
78
+ concurrent-ruby (1.1.10)
79
+ connection_pool (2.4.1)
75
80
  crass (1.0.6)
76
- diff-lcs (1.4.4)
81
+ diff-lcs (1.5.0)
82
+ digest (3.1.0)
77
83
  docile (1.4.0)
78
- erubi (1.10.0)
79
- globalid (0.4.2)
80
- activesupport (>= 4.2.0)
81
- i18n (1.8.10)
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.10.0)
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.1)
94
+ marcel (1.0.2)
89
95
  method_source (1.0.0)
90
- mini_mime (1.0.3)
91
- minitest (5.14.4)
92
- nio4r (2.5.7)
93
- nokogiri (1.11.7-x86_64-linux)
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.13.1)
115
+ pry (0.14.1)
96
116
  coderay (~> 1.1)
97
117
  method_source (~> 1.0)
98
- pry-byebug (3.9.0)
99
- byebug (~> 11.0)
100
- pry (~> 0.13.0)
101
- racc (1.5.2)
102
- rack (2.2.3)
103
- rack-test (1.1.0)
104
- rack (>= 1.0, < 3)
105
- rails (6.1.3.2)
106
- actioncable (= 6.1.3.2)
107
- actionmailbox (= 6.1.3.2)
108
- actionmailer (= 6.1.3.2)
109
- actionpack (= 6.1.3.2)
110
- actiontext (= 6.1.3.2)
111
- actionview (= 6.1.3.2)
112
- activejob (= 6.1.3.2)
113
- activemodel (= 6.1.3.2)
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.8)
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 (= 6.1.3.2)
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.0)
139
+ rails-html-sanitizer (1.4.3)
124
140
  loofah (~> 2.3)
125
- railties (6.1.3.2)
126
- actionpack (= 6.1.3.2)
127
- activesupport (= 6.1.3.2)
141
+ railties (7.0.3.1)
142
+ actionpack (= 7.0.3.1)
143
+ activesupport (= 7.0.3.1)
128
144
  method_source
129
- rake (>= 0.8.7)
145
+ rake (>= 12.2)
130
146
  thor (~> 1.0)
131
- rake (13.0.3)
132
- redis (4.6.0)
133
- rspec (3.10.0)
134
- rspec-core (~> 3.10.0)
135
- rspec-expectations (~> 3.10.0)
136
- rspec-mocks (~> 3.10.0)
137
- rspec-core (3.10.1)
138
- rspec-support (~> 3.10.0)
139
- rspec-expectations (3.10.1)
147
+ zeitwerk (~> 2.5)
148
+ rake (13.0.6)
149
+ redis-client (0.15.0)
150
+ connection_pool
151
+ rspec (3.11.0)
152
+ rspec-core (~> 3.11.0)
153
+ rspec-expectations (~> 3.11.0)
154
+ rspec-mocks (~> 3.11.0)
155
+ rspec-core (3.11.0)
156
+ rspec-support (~> 3.11.0)
157
+ rspec-expectations (3.11.0)
140
158
  diff-lcs (>= 1.2.0, < 2.0)
141
- rspec-support (~> 3.10.0)
142
- rspec-mocks (3.10.2)
159
+ rspec-support (~> 3.11.0)
160
+ rspec-mocks (3.11.1)
143
161
  diff-lcs (>= 1.2.0, < 2.0)
144
- rspec-support (~> 3.10.0)
145
- rspec-support (3.10.2)
146
- rspec_junit_formatter (0.4.1)
162
+ rspec-support (~> 3.11.0)
163
+ rspec-support (3.11.0)
164
+ rspec_junit_formatter (0.5.1)
147
165
  rspec-core (>= 2, < 4, != 2.12.0)
148
- sidekiq (6.4.1)
149
- connection_pool (>= 2.2.2)
150
- rack (~> 2.0)
151
- redis (>= 4.2.0)
166
+ sidekiq (7.1.2)
167
+ concurrent-ruby (< 2)
168
+ connection_pool (>= 2.3.0)
169
+ rack (>= 2.2.4)
170
+ redis-client (>= 0.14.0)
152
171
  simplecov (0.21.2)
153
172
  docile (~> 1.1)
154
173
  simplecov-html (~> 0.11)
155
174
  simplecov_json_formatter (~> 0.1)
156
175
  simplecov-html (0.12.3)
157
- simplecov_json_formatter (0.1.3)
158
- sprockets (4.0.2)
159
- concurrent-ruby (~> 1.0)
160
- rack (> 1, < 3)
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)
176
+ simplecov_json_formatter (0.1.4)
177
+ strscan (3.0.4)
178
+ thor (1.2.1)
179
+ timeout (0.3.0)
167
180
  timeoutable (1.1.1)
168
181
  timeout
169
- tzinfo (2.0.4)
182
+ tzinfo (2.0.5)
170
183
  concurrent-ruby (~> 1.0)
171
184
  websocket-driver (0.7.5)
172
185
  websocket-extensions (>= 0.1.0)
173
186
  websocket-extensions (0.1.5)
174
- zeitwerk (2.4.2)
187
+ zeitwerk (2.6.0)
175
188
 
176
189
  PLATFORMS
177
190
  x86_64-linux
178
191
 
179
192
  DEPENDENCIES
180
- pry-byebug
193
+ pry
181
194
  rails
182
195
  rake (~> 13.0)
183
196
  rspec (~> 3.0)
@@ -186,4 +199,4 @@ DEPENDENCIES
186
199
  simplecov
187
200
 
188
201
  BUNDLED WITH
189
- 2.2.19
202
+ 2.4.18
@@ -4,49 +4,48 @@ module Sidekiq
4
4
  module WebCustom
5
5
  class Processor < ::Sidekiq::Processor
6
6
 
7
- def self.execute(max:, queue:, options: Sidekiq.options)
7
+ def self.execute(max:, queue:, options: Sidekiq.default_configuration.default_capsule)
8
8
  __processor__(queue: queue, options: options).__execute(max: max)
9
9
  end
10
10
 
11
- def self.execute_job(job:, options: Sidekiq.options)
11
+ def self.execute_job(job:, options: Sidekiq.default_configuration.default_capsule)
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.options)
18
- options_temp = options.clone
17
+ def self.__processor__(queue:, options: Sidekiq.default_configuration.default_capsule)
18
+ options_temp = options.dup
19
19
  queue = queue.is_a?(String) ? Sidekiq::Queue.new(queue) : queue
20
20
 
21
- options_temp[:queues] = [queue.name]
22
- klass = options_temp[:fetch]&.class || BasicFetch
23
- options_temp[:fetch] = klass.new(options_temp)
24
- new(manager: nil, options: options_temp, queue: queue)
21
+ options_temp.queues = [queue.name]
22
+
23
+ new(options: options_temp, queue: queue)
25
24
  end
26
25
 
27
- def initialize(manager:, options:, queue:)
26
+ def initialize(options:, queue:)
28
27
  @__queue = queue
29
- @__basic_fetch = options[:fetch].class == BasicFetch
28
+ @__basic_fetch = options.fetcher.class == BasicFetch
30
29
 
31
- super(manager, options)
30
+ super(options)
32
31
  end
33
32
 
34
33
  def __execute_job(job:)
35
34
  queue_name = "queue:#{job.queue}"
36
35
  work_unit = Sidekiq::BasicFetch::UnitOfWork.new(queue_name, job.item.to_json)
37
36
  begin
38
- Sidekiq.logger.info "Manually processing individual work unit for #{work_unit.queue_name}"
37
+ logger.info "Manually processing individual work unit for #{work_unit.queue_name}"
39
38
  process(work_unit)
40
39
  rescue StandardError => e
41
- Sidekiq.logger.error "Manually processed work unit failed with #{e.message}. Work unit will not be dequeued"
40
+ logger.error "Manually processed work unit failed with #{e.message}. Work unit will not be dequeued"
42
41
  raise e
43
42
  end
44
43
 
45
44
  begin
46
45
  job.delete
47
- Sidekiq.logger.info { "Manually processed work unit sucessfully dequeued." }
46
+ logger.info { "Manually processed work unit sucessfully dequeued." }
48
47
  rescue StandardError => e
49
- Sidekiq.logger.fatal "Manually processed work unit failed to be dequeued. #{e.message}."
48
+ logger.fatal "Manually processed work unit failed to be dequeued. #{e.message}."
50
49
  raise e
51
50
  end
52
51
 
@@ -59,21 +58,21 @@ module Sidekiq
59
58
  break if @__queue.size <= 0
60
59
 
61
60
  if Thread.current[Sidekiq::WebCustom::BREAK_BIT]
62
- Sidekiq.logger.warn "Yikes -- Break bit has been set. Attempting to return in time. Completed #{count} of attempted #{max}"
61
+ logger.warn "Yikes -- Break bit has been set. Attempting to return in time. Completed #{count} of attempted #{max}"
63
62
  break
64
63
  end
65
64
 
66
- Sidekiq.logger.info { "Manually processing next item in queue:[#{@__queue.name}]" }
65
+ logger.info { "Manually processing next item in queue:[#{@__queue.name}]" }
67
66
  process_one
68
67
  count += 1
69
-
70
68
  end
69
+
71
70
  count
72
71
  rescue Exception => ex
73
72
  if @job && @__basic_fetch
74
- Sidekiq.logger.fatal "Processor Execution interrupted. Lost Job #{@job.job}"
73
+ logger.fatal "Processor Execution interrupted. Lost Job #{@job.job}"
75
74
  end
76
- Sidekiq.logger.warn "Manual execution has terminated. Received error [#{ex.message}]"
75
+ logger.warn "Manual execution has terminated. Received error [#{ex.message}]"
77
76
  return count
78
77
  end
79
78
  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 = 4 # With feature launch. Documentation of upgrade is useful via a changelog
7
- PATCH = 1 # With minor upgrades or patcing a small bug. No changelog necessary
6
+ MINOR = 6 # 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
@@ -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
@@ -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.4.0")
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.0'
36
+ spec.add_dependency 'sidekiq', '~> 7'
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.1
4
+ version: 0.6.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-04-09 00:00:00.000000000 Z
11
+ date: 2023-08-07 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.0'
19
+ version: '7'
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.0'
26
+ version: '7'
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.4.0
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.2.32
149
+ rubygems_version: 3.4.10
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: This gem adds on custom capabilities to the Sidekiq Web UI