govuk_sidekiq 1.0.3 → 2.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
  SHA1:
3
- metadata.gz: 35e136c2c5bc0a583e4f7753107027f9109c31db
4
- data.tar.gz: cb216e639c4c4a9ad2ea4947a25ab2a115329702
3
+ metadata.gz: 3aee561f69e1eedfe1142713f3477597dc773427
4
+ data.tar.gz: b90f651358f70dfdcd0f66d2490ee47d6ceed252
5
5
  SHA512:
6
- metadata.gz: 3d8437aadb751c4238d8a76c73e1af1c70c9230d532c83ca092296aee9b277aa1f573c32861f78bbcf8722a03434094b1b8c95eed18bc6f207bbdb975db3d442
7
- data.tar.gz: 8a9b822af41ac13cd381b0c07d6425208ab40a9ae1fe864206bcefa94643a060306a0e2a2a3bef658790ed8567e42e7f3ed603719711cdb0fa268bbf42b34132
6
+ metadata.gz: e2dd6b60266dfc6d8db43268e669b29300a48ee5c95290f2468bc87899f4dfec2fd33ad466fe72d27716a9e0123c18526c869a387871baf842014469c810b739
7
+ data.tar.gz: 5c2ff2c94185cc3328f33702b288a6ee805af767f265ef252dea19833dc6a9c22df2f36323c84f75768014c6677d90d0ef15a45ebd0d996f086be3c7d02d08b0
data/README.md CHANGED
@@ -50,7 +50,16 @@ worker: bundle exec sidekiq -C ./config/sidekiq.yml
50
50
  ### 4. Configure puppet
51
51
 
52
52
  - Set `REDIS_HOST` and `REDIS_PORT` variables. `GOVUK_APP_NAME` should also be
53
- set, but this is already done by the default `govuk::app::config`.
53
+ set, but this is already done by the default `govuk::app::config`. If your Redis instance
54
+ requires more advanced connection settings (eg username and password) you can instead
55
+ set a `REDIS_URL` variable, this will take precidence over `REDIS_HOST` and `REDIS_PORT`.
56
+
57
+ Apply redis variables for your app in [the default config](https://github.com/alphagov/govuk-puppet/blob/master/hieradata/common.yaml). For example:
58
+
59
+ ```
60
+ govuk::apps::your_app::redis_host: "%{hiera('sidekiq_host')}"
61
+ govuk::apps::your_app::redis_port: "%{hiera('sidekiq_port')}"
62
+ ```
54
63
  - Make sure puppet creates and starts the Procfile worker.
55
64
 
56
65
  There's no step-by-step guide for this, but [you can copy the config from collections-publisher](https://github.com/alphagov/govuk-puppet/blob/master/modules/govuk/manifests/apps/collections_publisher.pp).
@@ -73,7 +82,7 @@ See the [Pinfile](https://github.gds/gds/development/blob/master/Pinfile) and
73
82
 
74
83
  ### 7. Add app to sidekiq-monitoring
75
84
 
76
- See the opsmanual for a step-by-step guide: [HOWTO: Add sidekiq-monitoring to your application](https://github.gds/pages/gds/opsmanual/infrastructure/howto/setting-up-new-sidekiq-monitoring-app.html)
85
+ See the opsmanual for a step-by-step guide: [HOWTO: Add sidekiq-monitoring to your application](https://docs.publishing.service.gov.uk/manual/setting-up-new-sidekiq-monitoring-app.html)
77
86
 
78
87
  ### 8. Create some jobs
79
88
 
@@ -3,10 +3,18 @@ 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
+
6
15
  SidekiqInitializer.setup_sidekiq(
7
16
  ENV["GOVUK_APP_NAME"] || app.root.basename.to_s,
8
- ENV["REDIS_HOST"] || "127.0.0.1",
9
- ENV["REDIS_PORT"] || 6379
17
+ config
10
18
  )
11
19
  end
12
20
  end
@@ -1,22 +1,18 @@
1
1
  require "sidekiq"
2
2
  require "sidekiq/logging/json"
3
3
  require "sidekiq-statsd"
4
- require "airbrake"
5
4
  require "govuk_sidekiq/api_headers"
6
5
 
7
6
  module GovukSidekiq
8
7
  module SidekiqInitializer
9
- def self.setup_sidekiq(govuk_app_name, redis_host, redis_port)
10
- redis_config = {
11
- host: redis_host,
12
- port: redis_port,
8
+ def self.setup_sidekiq(govuk_app_name, redis_config)
9
+ redis_config = redis_config.merge(
13
10
  namespace: govuk_app_name,
14
11
  reconnect_attempts: 1,
15
- }
12
+ )
16
13
 
17
14
  Sidekiq.configure_server do |config|
18
15
  config.redis = redis_config
19
- config.error_handlers << Proc.new { |ex, context_hash| Airbrake.notify(ex, context_hash) }
20
16
 
21
17
  config.server_middleware do |chain|
22
18
  chain.add Sidekiq::Statsd::ServerMiddleware, env: "govuk.app.#{govuk_app_name}", prefix: "workers"
@@ -1,3 +1,3 @@
1
1
  module GovukSidekiq
2
- VERSION = "1.0.3"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Crosby-McCullough
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-13 00:00:00.000000000 Z
11
+ date: 2017-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 19.1.0
69
- - !ruby/object:Gem::Dependency
70
- name: airbrake
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: 3.1.0
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: 3.1.0
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: redis-namespace
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -123,33 +109,33 @@ dependencies:
123
109
  - !ruby/object:Gem::Version
124
110
  version: '11.1'
125
111
  - !ruby/object:Gem::Dependency
126
- name: bundler
112
+ name: railties
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
- - - ">="
115
+ - - "~>"
130
116
  - !ruby/object:Gem::Version
131
- version: '1.10'
117
+ version: 5.0.1
132
118
  type: :development
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
- - - ">="
122
+ - - "~>"
137
123
  - !ruby/object:Gem::Version
138
- version: '1.10'
124
+ version: 5.0.1
139
125
  - !ruby/object:Gem::Dependency
140
- name: gem_publisher
126
+ name: bundler
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
- - - '='
129
+ - - ">="
144
130
  - !ruby/object:Gem::Version
145
- version: 1.5.0
131
+ version: '1.10'
146
132
  type: :development
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
- - - '='
136
+ - - ">="
151
137
  - !ruby/object:Gem::Version
152
- version: 1.5.0
138
+ version: '1.10'
153
139
  description:
154
140
  email:
155
141
  - elliot.cm@gmail.com
@@ -185,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
171
  version: '0'
186
172
  requirements: []
187
173
  rubyforge_project:
188
- rubygems_version: 2.5.1
174
+ rubygems_version: 2.6.8
189
175
  signing_key:
190
176
  specification_version: 4
191
177
  summary: Provides standard setup and behaviour for Sidekiq in GOV.UK applications.