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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b843dd9ee6f1e39c88bea10dacd981c943cce580ae2f8fefa699cc4f98a148c
4
- data.tar.gz: 822d7ddf7bdff16b66ea2d0259355d98e9abb140e33d89043f2b3fb04aa8de50
3
+ metadata.gz: 815bd23151114eb4c72a9f191c8038a394a8f3dd50b8209eb11cd1df03a70246
4
+ data.tar.gz: 3be935aeb2523cbe18febb5f1e173bb4b5fe8c1e9cad07f1a2338d4a81010e0a
5
5
  SHA512:
6
- metadata.gz: 440af8e263e8e989282afa19601b296c11eb370304b37d4e8089c912c9990aae485412627e353132daa772090fc43c2ba62d2a377f8c8cfa265d9b3d31d97a49
7
- data.tar.gz: 639231fad41d053fc900801985b1650c37c94eb0128e3b72a8825f1ef3c6e3092fabc2b2809f11db453c28e413e6ffbbfbbc7e31c2d0168dc14c8cb3f01c66da
6
+ metadata.gz: b3f0257f49ef4d2170e50923489f70404d792ede869b3298f415b3c9d56f32edb5d9564adb2c50ab9e319598752f19a1515531901f8f357754111ea23a042887
7
+ data.tar.gz: dceab9cddad2591ddc1d9ba657c0958443684616557bd0c51653996369c415ba7911119bf9a20a7f5d9f7a8e8a85145654eba59a5e6920fc5c1f4e3f17f0364c
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
@@ -2,182 +2,193 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  sidekiq-web_custom (0.4.1)
5
- sidekiq (~> 6.0)
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 (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)
78
+ concurrent-ruby (1.1.10)
74
79
  connection_pool (2.2.5)
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.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 (= 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 (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.10.0)
142
- rspec-mocks (3.10.2)
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.10.0)
145
- rspec-support (3.10.2)
146
- rspec_junit_formatter (0.4.1)
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.1)
165
+ sidekiq (6.5.4)
149
166
  connection_pool (>= 2.2.2)
150
167
  rack (~> 2.0)
151
- redis (>= 4.2.0)
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.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)
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.4)
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.4.2)
185
+ zeitwerk (2.6.0)
175
186
 
176
187
  PLATFORMS
177
188
  x86_64-linux
178
189
 
179
190
  DEPENDENCIES
180
- pry-byebug
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.2.19
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.options)
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.options)
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.options)
18
- options_temp = options.clone
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
- new(manager: nil, options: options_temp, queue: queue)
24
+
25
+ new(options: options_temp, queue: queue)
25
26
  end
26
27
 
27
- def initialize(manager:, options:, queue:)
28
+ def initialize(options:, queue:)
28
29
  @__queue = queue
29
30
  @__basic_fetch = options[:fetch].class == BasicFetch
30
31
 
31
- super(manager, options)
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
- Sidekiq.logger.info "Manually processing individual work unit for #{work_unit.queue_name}"
39
+ logger.info "Manually processing individual work unit for #{work_unit.queue_name}"
39
40
  process(work_unit)
40
41
  rescue StandardError => e
41
- Sidekiq.logger.error "Manually processed work unit failed with #{e.message}. Work unit will not be dequeued"
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
- Sidekiq.logger.info { "Manually processed work unit sucessfully dequeued." }
48
+ logger.info { "Manually processed work unit sucessfully dequeued." }
48
49
  rescue StandardError => e
49
- Sidekiq.logger.fatal "Manually processed work unit failed to be dequeued. #{e.message}."
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
- Sidekiq.logger.warn "Yikes -- Break bit has been set. Attempting to return in time. Completed #{count} of attempted #{max}"
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
- Sidekiq.logger.info { "Manually processing next item in queue:[#{@__queue.name}]" }
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
- Sidekiq.logger.fatal "Processor Execution interrupted. Lost Job #{@job.job}"
75
+ logger.fatal "Processor Execution interrupted. Lost Job #{@job.job}"
75
76
  end
76
- Sidekiq.logger.warn "Manual execution has terminated. Received error [#{ex.message}]"
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 = 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 = 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
@@ -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', '~> 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.1
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-04-09 00:00:00.000000000 Z
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.0'
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.0'
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.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.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