govuk_sidekiq 3.0.2 → 5.0.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: 23187ce51bf6c5d63ab70c2c453f38fa3d680d207ababdf0a4d9cabe127df81e
4
- data.tar.gz: a8ca1c0719c38e20dc2d49863e086e3a0f797bad92ad6a02e4768d30ae15493a
3
+ metadata.gz: 360dbfaafbf182d077a3d010a9b8f7aef892873a74dba9d5360225873bb3dd9e
4
+ data.tar.gz: 57f5fdc1396bb897fb91497d49dfbe42e63e6d0ed4678484eff67ac9946160a8
5
5
  SHA512:
6
- metadata.gz: eac19e0739519cb5658bf3a6bf2785cc07c2fdeff4f1c11decb47ec4cace0046cd5237893455654475bec439ac47b16cd28c5dcbca8019513aa3b96b14fa9d71
7
- data.tar.gz: 1fe68cb417ee2619c47e65d323185c697b515f70084ce66a0a4af142334505bdac7ffe31fe098a86590cad3a08180c305211976eab63d9ceec3e798b18ad40df
6
+ metadata.gz: 592383166d00c61ac5691cc203545c95664bdbc16e5551db9a3df4ad549c197f22a1a49a59ee35a1839ed759ab4adcb2fb2f5bb0b6cd4d0ba4f42ac9b7530592
7
+ data.tar.gz: 1122c8ac78c73e2d881510d34156d1b2b718433d5e72a2402e870dce15ebc15513391aa2ab136764b9908d2b8ac7cf298e4b0aa55e37dec06f8a3bea04c2bbe8
data/README.md CHANGED
@@ -50,10 +50,8 @@ worker: bundle exec sidekiq -C ./config/sidekiq.yml
50
50
 
51
51
  ### 4. Configure puppet
52
52
 
53
- - Set `REDIS_HOST` and `REDIS_PORT` variables. `GOVUK_APP_NAME` should also be
54
- set, but this is already done by the default `govuk::app::config`. If your Redis instance
55
- requires more advanced connection settings (eg username and password) you can instead
56
- set a `REDIS_URL` variable, this will take precidence over `REDIS_HOST` and `REDIS_PORT`.
53
+ - Set a `REDIS_URL` environment variable. `GOVUK_APP_NAME` should also be
54
+ set, but this is already done by the default `govuk::app::config`.
57
55
 
58
56
  Apply redis variables for your app in [the default config](https://github.com/alphagov/govuk-puppet/blob/master/hieradata/common.yaml). For example:
59
57
 
@@ -7,7 +7,7 @@ module GovukSidekiq
7
7
  #
8
8
  # https://github.com/mperham/sidekiq/wiki/Middleware#client-side-middleware
9
9
  class ClientMiddleware
10
- def call(worker_class, job, queue, redis_pool)
10
+ def call(_worker_class, job, _queue, _redis_pool)
11
11
  last_arg = job["args"].last
12
12
 
13
13
  if is_header_hash(last_arg)
@@ -36,7 +36,7 @@ module GovukSidekiq
36
36
  #
37
37
  # https://github.com/mperham/sidekiq/wiki/Middleware#server-side-middleware
38
38
  class ServerMiddleware
39
- def call(worker, message, queue)
39
+ def call(_worker, message, _queue)
40
40
  last_arg = message["args"].last
41
41
 
42
42
  if last_arg.is_a?(Hash) && last_arg.keys.include?("request_id")
@@ -3,18 +3,9 @@ require "govuk_sidekiq/sidekiq_initializer"
3
3
  module GovukSidekiq
4
4
  class Railtie < Rails::Railtie
5
5
  initializer "govuk_sidekiq.initialize_sidekiq" do |app|
6
- config = if ENV['REDIS_URL']
7
- { url: ENV['REDIS_URL'] }
8
- else
9
- {
10
- host: ENV.fetch("REDIS_HOST", "127.0.0.1"),
11
- port: ENV.fetch("REDIS_PORT", 6379)
12
- }
13
- end
14
-
15
6
  SidekiqInitializer.setup_sidekiq(
16
7
  ENV["GOVUK_APP_NAME"] || app.root.basename.to_s,
17
- config
8
+ { url: ENV.fetch("REDIS_URL", "redis://127.0.0.1:6379") },
18
9
  )
19
10
  end
20
11
  end
@@ -6,7 +6,7 @@ require "govuk_app_config/govuk_statsd"
6
6
 
7
7
  module GovukSidekiq
8
8
  module SidekiqInitializer
9
- def self.setup_sidekiq(govuk_app_name, redis_config)
9
+ def self.setup_sidekiq(govuk_app_name, redis_config = {})
10
10
  redis_config = redis_config.merge(
11
11
  namespace: govuk_app_name,
12
12
  reconnect_attempts: 1,
@@ -29,7 +29,7 @@ module GovukSidekiq
29
29
  end
30
30
  end
31
31
 
32
- Sidekiq.logger.formatter = Sidekiq::Logging::Json::Logger.new
32
+ Sidekiq.logger.formatter = Sidekiq::Logging::Json::Logger.new if Sidekiq.options[:logfile]
33
33
  end
34
34
  end
35
35
  end
@@ -1,3 +1,3 @@
1
1
  module GovukSidekiq
2
- VERSION = "3.0.2"
2
+ VERSION = "5.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,119 +1,119 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-11 00:00:00.000000000 Z
11
+ date: 2021-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: sidekiq
14
+ name: gds-api-adapters
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '6'
19
+ version: 19.1.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: '5'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '6'
26
+ version: 19.1.0
33
27
  - !ruby/object:Gem::Dependency
34
- name: sidekiq-statsd
28
+ name: govuk_app_config
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - "~>"
31
+ - - ">="
38
32
  - !ruby/object:Gem::Version
39
- version: '0.1'
33
+ version: '1.1'
40
34
  type: :runtime
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
- - - "~>"
38
+ - - ">="
45
39
  - !ruby/object:Gem::Version
46
- version: '0.1'
40
+ version: '1.1'
47
41
  - !ruby/object:Gem::Dependency
48
- name: sidekiq-logging-json
42
+ name: redis-namespace
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0.0'
47
+ version: '1.6'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
52
  - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: '0.0'
54
+ version: '1.6'
61
55
  - !ruby/object:Gem::Dependency
62
- name: gds-api-adapters
56
+ name: sidekiq
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
59
  - - ">="
66
60
  - !ruby/object:Gem::Version
67
- version: 19.1.0
61
+ version: '5'
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: '6'
68
65
  type: :runtime
69
66
  prerelease: false
70
67
  version_requirements: !ruby/object:Gem::Requirement
71
68
  requirements:
72
69
  - - ">="
73
70
  - !ruby/object:Gem::Version
74
- version: 19.1.0
71
+ version: '5'
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '6'
75
75
  - !ruby/object:Gem::Dependency
76
- name: redis-namespace
76
+ name: sidekiq-logging-json
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '1.6'
81
+ version: '0.0'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '1.6'
88
+ version: '0.0'
89
89
  - !ruby/object:Gem::Dependency
90
- name: govuk_app_config
90
+ name: sidekiq-statsd
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: '1.1'
95
+ version: '2.1'
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: '1.1'
102
+ version: '2.1'
103
103
  - !ruby/object:Gem::Dependency
104
- name: rspec
104
+ name: railties
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '3.4'
109
+ version: '5.0'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '3.4'
116
+ version: '5.0'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: rake
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -129,19 +129,19 @@ dependencies:
129
129
  - !ruby/object:Gem::Version
130
130
  version: '12.3'
131
131
  - !ruby/object:Gem::Dependency
132
- name: railties
132
+ name: rspec
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '5.0'
137
+ version: '3.4'
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '5.0'
144
+ version: '3.4'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: bundler
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -156,6 +156,20 @@ dependencies:
156
156
  - - ">="
157
157
  - !ruby/object:Gem::Version
158
158
  version: '1.10'
159
+ - !ruby/object:Gem::Dependency
160
+ name: rubocop-govuk
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
159
173
  description:
160
174
  email:
161
175
  - govuk-dev@digital.cabinet-office.gov.uk
@@ -183,15 +197,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
197
  requirements:
184
198
  - - ">="
185
199
  - !ruby/object:Gem::Version
186
- version: '2.2'
200
+ version: '2.6'
187
201
  required_rubygems_version: !ruby/object:Gem::Requirement
188
202
  requirements:
189
203
  - - ">="
190
204
  - !ruby/object:Gem::Version
191
205
  version: '0'
192
206
  requirements: []
193
- rubyforge_project:
194
- rubygems_version: 2.7.6
207
+ rubygems_version: 3.1.4
195
208
  signing_key:
196
209
  specification_version: 4
197
210
  summary: Provides standard setup and behaviour for Sidekiq in GOV.UK applications.