sidekiq 6.0.1 → 6.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of sidekiq might be problematic. Click here for more details.

Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +147 -2
  3. data/LICENSE +1 -1
  4. data/README.md +4 -7
  5. data/bin/sidekiq +26 -2
  6. data/lib/generators/sidekiq/worker_generator.rb +1 -1
  7. data/lib/sidekiq/api.rb +151 -111
  8. data/lib/sidekiq/cli.rb +39 -10
  9. data/lib/sidekiq/client.rb +26 -15
  10. data/lib/sidekiq/extensions/action_mailer.rb +3 -2
  11. data/lib/sidekiq/extensions/active_record.rb +4 -3
  12. data/lib/sidekiq/extensions/class_methods.rb +5 -4
  13. data/lib/sidekiq/extensions/generic_proxy.rb +3 -1
  14. data/lib/sidekiq/fetch.rb +29 -21
  15. data/lib/sidekiq/job.rb +8 -0
  16. data/lib/sidekiq/job_logger.rb +2 -2
  17. data/lib/sidekiq/job_retry.rb +11 -12
  18. data/lib/sidekiq/launcher.rb +104 -24
  19. data/lib/sidekiq/logger.rb +12 -11
  20. data/lib/sidekiq/manager.rb +4 -4
  21. data/lib/sidekiq/middleware/chain.rb +6 -4
  22. data/lib/sidekiq/monitor.rb +2 -17
  23. data/lib/sidekiq/processor.rb +17 -39
  24. data/lib/sidekiq/rails.rb +16 -18
  25. data/lib/sidekiq/redis_connection.rb +21 -13
  26. data/lib/sidekiq/scheduled.rb +7 -1
  27. data/lib/sidekiq/sd_notify.rb +149 -0
  28. data/lib/sidekiq/systemd.rb +24 -0
  29. data/lib/sidekiq/testing.rb +2 -4
  30. data/lib/sidekiq/util.rb +28 -2
  31. data/lib/sidekiq/version.rb +1 -1
  32. data/lib/sidekiq/web/action.rb +2 -2
  33. data/lib/sidekiq/web/application.rb +30 -19
  34. data/lib/sidekiq/web/csrf_protection.rb +180 -0
  35. data/lib/sidekiq/web/helpers.rb +35 -24
  36. data/lib/sidekiq/web/router.rb +6 -5
  37. data/lib/sidekiq/web.rb +37 -73
  38. data/lib/sidekiq/worker.rb +4 -7
  39. data/lib/sidekiq.rb +14 -8
  40. data/sidekiq.gemspec +12 -5
  41. data/web/assets/images/apple-touch-icon.png +0 -0
  42. data/web/assets/javascripts/application.js +25 -27
  43. data/web/assets/stylesheets/application-dark.css +146 -124
  44. data/web/assets/stylesheets/application.css +35 -135
  45. data/web/locales/ar.yml +8 -2
  46. data/web/locales/de.yml +14 -2
  47. data/web/locales/en.yml +5 -0
  48. data/web/locales/es.yml +18 -2
  49. data/web/locales/fr.yml +10 -3
  50. data/web/locales/ja.yml +5 -0
  51. data/web/locales/lt.yml +83 -0
  52. data/web/locales/pl.yml +4 -4
  53. data/web/locales/ru.yml +4 -0
  54. data/web/locales/vi.yml +83 -0
  55. data/web/views/_job_info.erb +1 -1
  56. data/web/views/busy.erb +50 -19
  57. data/web/views/dashboard.erb +14 -6
  58. data/web/views/dead.erb +1 -1
  59. data/web/views/layout.erb +2 -1
  60. data/web/views/morgue.erb +6 -6
  61. data/web/views/queue.erb +1 -1
  62. data/web/views/queues.erb +10 -2
  63. data/web/views/retries.erb +7 -7
  64. data/web/views/retry.erb +1 -1
  65. data/web/views/scheduled.erb +1 -1
  66. metadata +26 -50
  67. data/.circleci/config.yml +0 -82
  68. data/.github/contributing.md +0 -32
  69. data/.github/issue_template.md +0 -11
  70. data/.gitignore +0 -13
  71. data/.standard.yml +0 -20
  72. data/3.0-Upgrade.md +0 -70
  73. data/4.0-Upgrade.md +0 -53
  74. data/5.0-Upgrade.md +0 -56
  75. data/6.0-Upgrade.md +0 -72
  76. data/COMM-LICENSE +0 -97
  77. data/Ent-2.0-Upgrade.md +0 -37
  78. data/Ent-Changes.md +0 -256
  79. data/Gemfile +0 -24
  80. data/Gemfile.lock +0 -196
  81. data/Pro-2.0-Upgrade.md +0 -138
  82. data/Pro-3.0-Upgrade.md +0 -44
  83. data/Pro-4.0-Upgrade.md +0 -35
  84. data/Pro-5.0-Upgrade.md +0 -25
  85. data/Pro-Changes.md +0 -776
  86. data/Rakefile +0 -10
  87. data/code_of_conduct.md +0 -50
@@ -14,7 +14,7 @@
14
14
  <form action="<%= root_path %>retries" method="post">
15
15
  <%= csrf_tag %>
16
16
  <div class="table_container">
17
- <table class="table table-striped table-bordered table-white">
17
+ <table class="table table-striped table-bordered table-hover">
18
18
  <thead>
19
19
  <tr>
20
20
  <th class="table-checkbox checkbox-column">
@@ -58,23 +58,23 @@
58
58
  <% end %>
59
59
  </table>
60
60
  </div>
61
- <input class="btn btn-primary btn-xs pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
62
- <input class="btn btn-danger btn-xs pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
63
- <input class="btn btn-danger btn-xs pull-left flip" type="submit" name="kill" value="<%= t('Kill') %>" />
61
+ <input class="btn btn-primary pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
62
+ <input class="btn btn-danger pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
63
+ <input class="btn btn-danger pull-left flip" type="submit" name="kill" value="<%= t('Kill') %>" />
64
64
  </form>
65
65
 
66
66
  <% unfiltered? do %>
67
67
  <form action="<%= root_path %>retries/all/delete" method="post">
68
68
  <%= csrf_tag %>
69
- <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
69
+ <input class="btn btn-danger pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
70
70
  </form>
71
71
  <form action="<%= root_path %>retries/all/retry" method="post">
72
72
  <%= csrf_tag %>
73
- <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
73
+ <input class="btn btn-danger pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
74
74
  </form>
75
75
  <form action="<%= root_path %>retries/all/kill" method="post">
76
76
  <%= csrf_tag %>
77
- <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="kill" value="<%= t('KillAll') %>" data-confirm="<%= t('AreYouSure') %>" />
77
+ <input class="btn btn-danger pull-right flip" type="submit" name="kill" value="<%= t('KillAll') %>" data-confirm="<%= t('AreYouSure') %>" />
78
78
  </form>
79
79
  <% end %>
80
80
 
data/web/views/retry.erb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <h3><%= t('Error') %></h3>
4
4
  <div class="table_container">
5
- <table class="error table table-bordered table-striped">
5
+ <table class="error table table-bordered table-striped table-hover">
6
6
  <tbody>
7
7
  <tr>
8
8
  <th><%= t('ErrorClass') %></th>
@@ -15,7 +15,7 @@
15
15
  <form action="<%= root_path %>scheduled" method="post">
16
16
  <%= csrf_tag %>
17
17
  <div class="table_container">
18
- <table class="table table-striped table-bordered table-white">
18
+ <table class="table table-striped table-bordered table-hover">
19
19
  <thead>
20
20
  <tr>
21
21
  <th class="checkbox-column">
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-02 00:00:00.000000000 Z
11
+ date: 2021-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.0
19
+ version: 4.2.0
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: 4.1.0
26
+ version: 4.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: connection_pool
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,30 +42,16 @@ dependencies:
42
42
  name: rack
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.0.0
47
+ version: '2.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: 2.0.0
55
- - !ruby/object:Gem::Dependency
56
- name: rack-protection
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: 2.0.0
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
52
+ - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: 2.0.0
54
+ version: '2.0'
69
55
  description: Simple, efficient background processing for Ruby.
70
56
  email:
71
57
  - mperham@gmail.com
@@ -75,33 +61,12 @@ executables:
75
61
  extensions: []
76
62
  extra_rdoc_files: []
77
63
  files:
78
- - ".circleci/config.yml"
79
- - ".github/contributing.md"
80
- - ".github/issue_template.md"
81
- - ".gitignore"
82
- - ".standard.yml"
83
- - 3.0-Upgrade.md
84
- - 4.0-Upgrade.md
85
- - 5.0-Upgrade.md
86
- - 6.0-Upgrade.md
87
- - COMM-LICENSE
88
64
  - Changes.md
89
- - Ent-2.0-Upgrade.md
90
- - Ent-Changes.md
91
- - Gemfile
92
- - Gemfile.lock
93
65
  - LICENSE
94
- - Pro-2.0-Upgrade.md
95
- - Pro-3.0-Upgrade.md
96
- - Pro-4.0-Upgrade.md
97
- - Pro-5.0-Upgrade.md
98
- - Pro-Changes.md
99
66
  - README.md
100
- - Rakefile
101
67
  - bin/sidekiq
102
68
  - bin/sidekiqload
103
69
  - bin/sidekiqmon
104
- - code_of_conduct.md
105
70
  - lib/generators/sidekiq/templates/worker.rb.erb
106
71
  - lib/generators/sidekiq/templates/worker_spec.rb.erb
107
72
  - lib/generators/sidekiq/templates/worker_test.rb.erb
@@ -117,6 +82,7 @@ files:
117
82
  - lib/sidekiq/extensions/class_methods.rb
118
83
  - lib/sidekiq/extensions/generic_proxy.rb
119
84
  - lib/sidekiq/fetch.rb
85
+ - lib/sidekiq/job.rb
120
86
  - lib/sidekiq/job_logger.rb
121
87
  - lib/sidekiq/job_retry.rb
122
88
  - lib/sidekiq/launcher.rb
@@ -130,6 +96,8 @@ files:
130
96
  - lib/sidekiq/rails.rb
131
97
  - lib/sidekiq/redis_connection.rb
132
98
  - lib/sidekiq/scheduled.rb
99
+ - lib/sidekiq/sd_notify.rb
100
+ - lib/sidekiq/systemd.rb
133
101
  - lib/sidekiq/testing.rb
134
102
  - lib/sidekiq/testing/inline.rb
135
103
  - lib/sidekiq/util.rb
@@ -137,10 +105,12 @@ files:
137
105
  - lib/sidekiq/web.rb
138
106
  - lib/sidekiq/web/action.rb
139
107
  - lib/sidekiq/web/application.rb
108
+ - lib/sidekiq/web/csrf_protection.rb
140
109
  - lib/sidekiq/web/helpers.rb
141
110
  - lib/sidekiq/web/router.rb
142
111
  - lib/sidekiq/worker.rb
143
112
  - sidekiq.gemspec
113
+ - web/assets/images/apple-touch-icon.png
144
114
  - web/assets/images/favicon.ico
145
115
  - web/assets/images/logo.png
146
116
  - web/assets/images/status.png
@@ -165,6 +135,7 @@ files:
165
135
  - web/locales/it.yml
166
136
  - web/locales/ja.yml
167
137
  - web/locales/ko.yml
138
+ - web/locales/lt.yml
168
139
  - web/locales/nb.yml
169
140
  - web/locales/nl.yml
170
141
  - web/locales/pl.yml
@@ -175,6 +146,7 @@ files:
175
146
  - web/locales/ta.yml
176
147
  - web/locales/uk.yml
177
148
  - web/locales/ur.yml
149
+ - web/locales/vi.yml
178
150
  - web/locales/zh-cn.yml
179
151
  - web/locales/zh-tw.yml
180
152
  - web/views/_footer.erb
@@ -195,11 +167,16 @@ files:
195
167
  - web/views/retry.erb
196
168
  - web/views/scheduled.erb
197
169
  - web/views/scheduled_job_info.erb
198
- homepage: http://sidekiq.org
170
+ homepage: https://sidekiq.org
199
171
  licenses:
200
172
  - LGPL-3.0
201
- metadata: {}
202
- post_install_message:
173
+ metadata:
174
+ homepage_uri: https://sidekiq.org
175
+ bug_tracker_uri: https://github.com/mperham/sidekiq/issues
176
+ documentation_uri: https://github.com/mperham/sidekiq/wiki
177
+ changelog_uri: https://github.com/mperham/sidekiq/blob/master/Changes.md
178
+ source_code_uri: https://github.com/mperham/sidekiq
179
+ post_install_message:
203
180
  rdoc_options: []
204
181
  require_paths:
205
182
  - lib
@@ -214,9 +191,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
191
  - !ruby/object:Gem::Version
215
192
  version: '0'
216
193
  requirements: []
217
- rubyforge_project:
218
- rubygems_version: 2.7.6
219
- signing_key:
194
+ rubygems_version: 3.1.4
195
+ signing_key:
220
196
  specification_version: 4
221
197
  summary: Simple, efficient background processing for Ruby
222
198
  test_files: []
data/.circleci/config.yml DELETED
@@ -1,82 +0,0 @@
1
- version: 2
2
- references:
3
- unit: &unit
4
- run:
5
- name: Run test suite
6
- command: bundle exec rake
7
- restore: &restore
8
- restore_cache:
9
- keys:
10
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
11
- # fallback to using the latest cache if no exact match is found
12
- - v1-dependencies-
13
- bundle: &bundle
14
- run:
15
- name: install dependencies
16
- command: |
17
- bundle install --jobs=4 --retry=3 --path vendor/bundle
18
- save: &save
19
- save_cache:
20
- paths:
21
- - ./vendor/bundle
22
- key: v1-dependencies-{{ checksum "Gemfile.lock" }}
23
- jobs:
24
- "ruby-2.5":
25
- docker:
26
- - image: circleci/ruby:2.5
27
- - image: circleci/redis:4.0
28
- steps:
29
- - checkout
30
- - <<: *restore
31
- - <<: *bundle
32
- - <<: *save
33
- - <<: *unit
34
- "ruby-2.6":
35
- environment:
36
- COVERAGE: true
37
- CC_TEST_REPORTER_ID: 003c3033501d70a2653bd887ff9a8b2884a263e6a4e27f2ba68748e15530918d
38
- docker:
39
- - image: circleci/ruby:2.6
40
- - image: circleci/redis:4.0
41
- steps:
42
- - checkout
43
- - <<: *restore
44
- - <<: *bundle
45
- - <<: *save
46
-
47
- - run:
48
- name: Setup Code Climate test-reporter
49
- command: |
50
- # download test reporter as a static binary
51
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
52
- chmod +x ./cc-test-reporter
53
-
54
- - run:
55
- name: Code Climate before-build
56
- command: |
57
- ./cc-test-reporter before-build
58
-
59
- - <<: *unit
60
-
61
- - run:
62
- name: Report code coverage to Code Climate
63
- command: |
64
- ./cc-test-reporter after-build -t simplecov --exit-code $?
65
- "jruby":
66
- docker:
67
- - image: circleci/jruby:latest
68
- - image: circleci/redis:4.0
69
- steps:
70
- - checkout
71
- - <<: *restore
72
- - <<: *bundle
73
- - <<: *save
74
- - <<: *unit
75
-
76
- workflows:
77
- version: 2
78
- build:
79
- jobs:
80
- - "ruby-2.5"
81
- - "ruby-2.6"
82
- - "jruby"
@@ -1,32 +0,0 @@
1
- # Contributing
2
-
3
- ## Issues
4
-
5
- When opening an issue:
6
-
7
- * include the full **backtrace** with your error
8
- * include your Sidekiq initializer
9
- * list versions you are using: Ruby, Rails, Sidekiq, OS, etc.
10
-
11
- It's always better to include more info rather than less.
12
-
13
- ## Code
14
-
15
- It's always best to open an issue before investing a lot of time into a
16
- fix or new functionality. Functionality must meet my design goals and
17
- vision for the project to be accepted; I would be happy to discuss how
18
- your idea can best fit into Sidekiq.
19
-
20
- ## Legal
21
-
22
- By submitting a Pull Request, you disavow any rights or claims to any changes
23
- submitted to the Sidekiq project and assign the copyright of
24
- those changes to Contributed Systems LLC.
25
-
26
- If you cannot or do not want to reassign those rights (your employment
27
- contract for your employer may not allow this), you should not submit a PR.
28
- Open an issue and someone else can do the work.
29
-
30
- This is a legal way of saying "If you submit a PR to us, that code becomes ours".
31
- 99.9% of the time that's what you intend anyways; we hope it doesn't scare you
32
- away from contributing.
@@ -1,11 +0,0 @@
1
- Ruby version:
2
- Sidekiq / Pro / Enterprise version(s):
3
-
4
- Please include your initializer and any error message with the full backtrace.
5
-
6
- Are you using an old version?
7
- Have you checked the changelogs to see if your issue has been fixed in a later version?
8
-
9
- https://github.com/mperham/sidekiq/blob/master/Changes.md
10
- https://github.com/mperham/sidekiq/blob/master/Pro-Changes.md
11
- https://github.com/mperham/sidekiq/blob/master/Ent-Changes.md
data/.gitignore DELETED
@@ -1,13 +0,0 @@
1
- .rvmrc
2
- .ruby-version
3
- tags
4
- *.swp
5
- dump.rdb
6
- .rbx
7
- coverage/
8
- vendor/
9
- .bundle/
10
- .sass-cache/
11
- tmp/
12
- pkg/*.gem
13
- .byebug_history
data/.standard.yml DELETED
@@ -1,20 +0,0 @@
1
- ruby_version: 2.5.0
2
- fix: false
3
- parallel: true
4
- ignore:
5
- - test/**/*
6
- - examples/**/*
7
- - myapp/**/*
8
- - 'lib/sidekiq.rb':
9
- - Lint/InheritException
10
- - 'lib/sidekiq/extensions/**/*':
11
- - Style/MethodMissingSuper
12
- - Style/MissingRespondToMissing
13
- - 'lib/**/*':
14
- - Naming/AsciiIdentifiers
15
- - Lint/RescueException
16
- - Security/YAMLLoad
17
- - Naming/AccessorMethodName
18
- - Naming/MethodName
19
- - Style/GlobalVars
20
- - Style/Alias
data/3.0-Upgrade.md DELETED
@@ -1,70 +0,0 @@
1
- # Upgrading to Sidekiq 3.0
2
-
3
- Sidekiq 3.0 brings several new features but also removes old APIs and
4
- changes a few data elements in Redis. To upgrade cleanly:
5
-
6
- * Upgrade to the latest Sidekiq 2.x and run it for a few weeks.
7
- `gem 'sidekiq', '< 3'`
8
- This is only needed if you have retries pending.
9
- * 3rd party gems which use **client-side middleware** will need to update
10
- due to an API change. The Redis connection for a particular job is
11
- passed thru the middleware to handle sharding where jobs can
12
- be pushed to different redis server instances.
13
-
14
- `def call(worker_class, msg, queue, redis_pool)`
15
-
16
- Client-side middleware should use `redis_pool.with { |conn| ... }` to
17
- perform Redis operations and **not** `Sidekiq.redis`.
18
- * If you used the capistrano integration, you'll need to pull in the
19
- new [capistrano-sidekiq](https://github.com/seuros/capistrano-sidekiq)
20
- gem and use it in your deploy.rb.
21
- * API changes:
22
- - `Sidekiq::Client.registered_workers` replaced by `Sidekiq::Workers.new`
23
- - `Sidekiq::Client.registered_queues` replaced by `Sidekiq::Queue.all`
24
- - `Sidekiq::Worker#retries_exhausted` replaced by `Sidekiq::Worker.sidekiq_retries_exhausted`
25
- - `Sidekiq::Workers#each` has changed significantly with a reworking
26
- of Sidekiq's internal process/thread data model.
27
- * `sidekiq/api` is no longer automatically required. If your code uses
28
- the API, you will need to require it.
29
- * Redis-to-Go is no longer transparently activated on Heroku so as to not play
30
- favorites with any particular Redis service. You need to set a config option
31
- for your app:
32
- `heroku config:set REDIS_PROVIDER=REDISTOGO_URL`. You may also use
33
- the generic `REDIS_URL`. See
34
- [Advanced Options: Setting the Location of your Redis server][1]
35
- for details.
36
- * Anyone using Airbrake, Honeybadger, Exceptional or ExceptionNotifier
37
- will need to update their error gem version to the latest to pull in
38
- Sidekiq support. Sidekiq will not provide explicit support for these
39
- services so as to not play favorites with any particular error service.
40
- * MRI 1.9 is no longer officially supported. Sidekiq's official
41
- support policy is to support the current and previous major releases
42
- of MRI and Rails. As of February 2014, that's MRI 2.1, MRI 2.0, JRuby 1.7, Rails 4.0
43
- and Rails 3.2. I will consider PRs to fix issues found by users for
44
- other platforms/versions.
45
-
46
- ## Error Service Providers
47
-
48
- If you previously provided a middleware to capture job errors, you
49
- should instead provide a global error handler with Sidekiq 3.0. This
50
- ensures **any** error within Sidekiq will be logged appropriately, not
51
- just during job execution.
52
-
53
- ```ruby
54
- if Sidekiq::VERSION < '3'
55
- # old behavior
56
- Sidekiq.configure_server do |config|
57
- config.server_middleware do |chain|
58
- chain.add MyErrorService::Middleware
59
- end
60
- end
61
- else
62
- Sidekiq.configure_server do |config|
63
- config.error_handlers << proc {|ex,context| MyErrorService.notify(ex, context) }
64
- end
65
- end
66
- ```
67
-
68
- Your error handler must respond to `call(exception, context_hash)`.
69
-
70
- [1]: https://github.com/mperham/sidekiq/wiki/Advanced-Options#via-env-variable
data/4.0-Upgrade.md DELETED
@@ -1,53 +0,0 @@
1
- # Welcome to Sidekiq 4.0!
2
-
3
- Sidekiq 4.0 contains a redesigned, more efficient core with less overhead per job.
4
- See my blog for [an overview of Sidekiq 4's higher performance](http://www.mikeperham.com/2015/10/14/optimizing-sidekiq/).
5
-
6
- ## What's New
7
-
8
- * Sidekiq no longer uses Celluloid. If your application code uses Celluloid,
9
- you will need to pull it in yourself.
10
-
11
- * `redis-namespace` has been removed from Sidekiq's gem dependencies. If
12
- you want to use namespacing ([and I strongly urge you not to](http://www.mikeperham.com/2015/09/24/storing-data-with-redis/)), you'll need to add the gem to your Gemfile:
13
- ```ruby
14
- gem 'redis-namespace'
15
- ```
16
-
17
- * **Redis 2.8.0 or greater is required.** Redis 2.8 was released two years
18
- ago and contains **many** useful features which Sidekiq couldn't
19
- leverage until now. **Redis 3.0.3 or greater is recommended** for large
20
- scale use [#2431](https://github.com/mperham/sidekiq/issues/2431).
21
-
22
- * Jobs are now fetched from Redis in parallel, making Sidekiq more
23
- resilient to high network latency. This means that Sidekiq requires
24
- more Redis connections per process. You must have a minimum of
25
- `concurrency + 2` connections in your pool or Sidekiq will exit.
26
- When in doubt, let Sidekiq size the connection pool for you.
27
-
28
- * Worker data is no longer updated in real-time but rather upon every
29
- heartbeat. Don't expect the `Sidekiq::Workers` API to be millisecond-precise.
30
-
31
- * There's a new testing API based off the `Sidekiq::Queues` namespace. All
32
- assertions made against the Worker class still work as expected.
33
- ```ruby
34
- assert_equal 0, Sidekiq::Queues["default"].size
35
- HardWorker.perform_async("log")
36
- assert_equal 1, Sidekiq::Queues["default"].size
37
- assert_equal "log", Sidekiq::Queues["default"].first['args'][0]
38
- Sidekiq::Queues.clear_all
39
- ```
40
-
41
- ## Upgrade
42
-
43
- First, make sure you are using Redis 2.8 or greater. Next:
44
-
45
- * Upgrade to the latest Sidekiq 3.x.
46
- ```ruby
47
- gem 'sidekiq', '< 4'
48
- ```
49
- * Fix any deprecation warnings you see.
50
- * Upgrade to 4.x.
51
- ```ruby
52
- gem 'sidekiq', '< 5'
53
- ```
data/5.0-Upgrade.md DELETED
@@ -1,56 +0,0 @@
1
- # Welcome to Sidekiq 5.0!
2
-
3
- Sidekiq 5.0 contains a reworked job dispatch and execution core to integrate
4
- better with the new Rails 5.0 Executor. It also drops support for older
5
- versions of Ruby and Rails and adds support for RTL languages in the Web UI.
6
-
7
- ## What's New
8
-
9
- * Integrate job logging and retry logic directly in with the job
10
- execution logic in Sidekiq::Processor. Previously this logic was
11
- defined as middleware. In Rails 5.0, ActiveSupport::Executor handles ActiveRecord
12
- connection management, job callbacks, development mode class loading,
13
- etc. Because of its extensive responsibilities, the Executor can't be
14
- integrated as Sidekiq middleware; the logging/retry logic had to be pulled out
15
- too. Sidekiq 4.2 had a hack to make it work but this redesign provides
16
- a cleaner integration. [#3235]
17
- * The Delayed Extensions `delay`, `delay_in` and `delay_until` APIs are
18
- no longer available by default. The extensions allow you to marshal
19
- job arguments as YAML, leading to cases where job payloads could be many
20
- 100s of KB or larger if not careful, leading to Redis networking
21
- timeouts or other problems. As noted in the Best Practices wiki page,
22
- Sidekiq is designed for jobs with small, simple arguments.
23
-
24
- Add this line to your initializer to re-enable them and get the old behavior:
25
- ```ruby
26
- Sidekiq::Extensions.enable_delay!
27
- ```
28
- The old `Sidekiq.remove_delay!` API has been removed as it is now the default. [#3299]
29
- * Sidekiq's quiet signal is now `TSTP` (think of it as **T**hread
30
- **ST**o**P**) instead of USR1 as USR1 is not available on JRuby.
31
- USR1 will continue to be supported in Sidekiq 5.x for backwards
32
- compatibility and will be removed in Sidekiq 6.x. [#3302]
33
- * The Web UI is now bi-directional - it can render either LTR
34
- (left-to-right) or RTL languages. With this change, **Farsi, Arabic,
35
- Hebrew and Urdu** are officially supported. [#3381]
36
- * Jobs which can't be parsed due to invalid JSON are now pushed
37
- immediately to the Dead set since they require manual intervention and
38
- will never execute successfully as is. The Web UI has been updated to
39
- more gracefully display these jobs. [#3296]
40
- * **Rails 3.2** is no longer supported.
41
- * **Ruby 2.0 and Ruby 2.1** are no longer supported. Ruby 2.2.2+ is required.
42
-
43
- ## Upgrade
44
-
45
- As always, please upgrade Sidekiq **one major version at a time**.
46
- If you are already running Sidekiq 4.x, then:
47
-
48
- * Upgrade to the latest Sidekiq 4.x.
49
- ```ruby
50
- gem 'sidekiq', '< 5'
51
- ```
52
- * Fix any deprecation warnings you see.
53
- * Upgrade to 5.x.
54
- ```ruby
55
- gem 'sidekiq', '< 6'
56
- ```
data/6.0-Upgrade.md DELETED
@@ -1,72 +0,0 @@
1
- # Welcome to Sidekiq 6.0!
2
-
3
- Sidekiq 6.0 contains some breaking changes which streamline proper operation
4
- of Sidekiq. It also drops support for EOL versions of Ruby and Rails.
5
-
6
- ## What's New
7
-
8
- This release has major breaking changes. Read and test carefully in production.
9
-
10
- - ActiveJobs can now use `sidekiq_options` directly to configure Sidekiq
11
- features/internals like the retry subsystem. Prefer the native
12
- Sidekiq::Worker APIs as some Sidekiq features (e.g. unique jobs) do not work well with AJ.
13
- (requires Rails 6.0.1)
14
- ```ruby
15
- class MyJob < ActiveJob::Base
16
- queue_as :myqueue
17
- sidekiq_options retry: 10, backtrace: 20
18
- def perform(...)
19
- end
20
- end
21
- ```
22
- - Logging has been redesigned to allow pluggable formatters and several
23
- formats ship with Sidekiq:
24
- * default - your typical output on macOS
25
- * heroku - enabled specifically when running in Heroku
26
- * json - a JSON format for search indexing, one hash per line
27
-
28
- Sidekiq will enable the best formatter for the detected environment but
29
- you can override it by configuring the log formatter explicitly. See
30
- 'sidekiq/logger' for implementation details.
31
-
32
- ```ruby
33
- Sidekiq.configure_server do |config|
34
- config.log_formatter = AcmeCorp::PlainLogFormatter.new
35
- # config.log_formatter = Sidekiq::Logger::Formatters::JSON.new
36
- end
37
- ```
38
- Please see the [Logging](https://github.com/mperham/sidekiq/wiki/Logging) wiki page for the latest documentation and notes.
39
- - **Remove the daemonization, logfile and pidfile command line arguments and `sidekiqctl` binary**.
40
- I've [noted for years](https://www.mikeperham.com/2014/09/22/dont-daemonize-your-daemons/)
41
- how modern services should be managed with a proper init system.
42
- Managing services manually is more error-prone, let your operating system do it for you.
43
- systemd, upstart, and foreman are three options. See the Deployment wiki page for the latest details.
44
- - **Validate proper usage of the `REDIS_PROVIDER` variable.**
45
- This variable is meant to hold the name of the environment
46
- variable which contains your Redis URL, so that you can switch Redis
47
- providers quickly and easily with a single variable change. It is not
48
- meant to hold the actual Redis URL itself. If you want to manually set
49
- the Redis URL then you may set `REDIS_URL` directly. [#3969]
50
- - **Increase default shutdown timeout from 8 seconds to 25 seconds.**
51
- Both Heroku and ECS now use 30 second shutdown timeout
52
- by default and we want Sidekiq to take advantage of this time. If you
53
- have deployment scripts which depend on the old default timeout, use `-t 8` to
54
- get the old behavior. [#3968]
55
- * **Rails <5** is no longer supported. Rails 6+ only works in zeitwerk mode.
56
- * **Ruby <2.5** is no longer supported.
57
- * **Redis <4** is no longer supported.
58
-
59
- ## Upgrade
60
-
61
- As always, please upgrade Sidekiq **one major version at a time**.
62
- If you are already running Sidekiq 5.x, then:
63
-
64
- * Upgrade to the latest Sidekiq 5.x.
65
- ```ruby
66
- gem 'sidekiq', '< 6'
67
- ```
68
- * Fix any deprecation warnings you see.
69
- * Upgrade to 6.x.
70
- ```ruby
71
- gem 'sidekiq', '< 7'
72
- ```