sidekiq-throttled 0.15.0 → 0.16.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +12 -0
  3. data/.github/workflows/ci.yml +11 -10
  4. data/.rubocop.yml +8 -7
  5. data/.rubocop_todo.yml +39 -3
  6. data/Appraisals +8 -12
  7. data/CHANGES.md +44 -0
  8. data/Gemfile +7 -5
  9. data/LICENSE.md +1 -0
  10. data/README.md +36 -32
  11. data/Rakefile +1 -1
  12. data/gemfiles/sidekiq_6.0.gemfile +7 -5
  13. data/gemfiles/sidekiq_6.1.gemfile +7 -5
  14. data/gemfiles/sidekiq_6.2.gemfile +7 -5
  15. data/gemfiles/sidekiq_6.3.gemfile +7 -5
  16. data/gemfiles/{sidekiq_5.2.gemfile → sidekiq_6.4.gemfile} +8 -6
  17. data/gemfiles/{sidekiq_5.1.gemfile → sidekiq_6.5.gemfile} +8 -6
  18. data/lib/sidekiq/throttled/communicator/callbacks.rb +1 -1
  19. data/lib/sidekiq/throttled/communicator/exception_handler.rb +25 -0
  20. data/lib/sidekiq/throttled/communicator/listener.rb +1 -1
  21. data/lib/sidekiq/throttled/communicator.rb +1 -1
  22. data/lib/sidekiq/throttled/configuration.rb +4 -4
  23. data/lib/sidekiq/throttled/expirable_list.rb +2 -5
  24. data/lib/sidekiq/throttled/fetch/unit_of_work.rb +7 -2
  25. data/lib/sidekiq/throttled/fetch.rb +5 -1
  26. data/lib/sidekiq/throttled/job.rb +128 -0
  27. data/lib/sidekiq/throttled/strategy/base.rb +6 -2
  28. data/lib/sidekiq/throttled/version.rb +1 -1
  29. data/lib/sidekiq/throttled/web/stats.rb +5 -4
  30. data/lib/sidekiq/throttled/worker.rb +6 -121
  31. data/lib/sidekiq/throttled.rb +15 -9
  32. data/{.rubocop → rubocop}/layout.yml +0 -0
  33. data/{.rubocop → rubocop}/lint.yml +0 -0
  34. data/{.rubocop → rubocop}/metrics.yml +0 -0
  35. data/{.rubocop → rubocop}/performance.yml +0 -0
  36. data/{.rubocop → rubocop}/rspec.yml +1 -1
  37. data/{.rubocop → rubocop}/style.yml +0 -0
  38. data/sidekiq-throttled.gemspec +6 -4
  39. metadata +20 -17
  40. data/gemfiles/sidekiq_5.0.gemfile +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6dcc92c4940527e645d6a211b068094aef5c1f1cb103ad07d74b9b42132eb80
4
- data.tar.gz: c2a8b341bfc9586a97f5f918b19bcf0e35ec4c93b5e2955802d26e5846cb7351
3
+ metadata.gz: 8f13258e6221758892919e37d8d233b33b52f46d3e6ae4f61700f009f1bb0553
4
+ data.tar.gz: a50132e8af4521c5c2d4f8edc3bcdc8d823160bd7c7ad2980bce6c4b10a29087
5
5
  SHA512:
6
- metadata.gz: d587a45dcf488a6ff722082c3ddf27c52bf19f4575fab922789580f36bae4031fe8f20d6825e0490d253f6f36f52a5c026b78bcd8b72de919fe094130c48c609
7
- data.tar.gz: cdf97140a7cc3bc78720f59acd629d54ea4fbca2d5a3b8696cb92695b1b73d7b070dc7074a4278af6562a01987eeee3e7ce57c5405b5d23b0fb54afdd04458d3
6
+ metadata.gz: 5cb7186478fa6eced7c69086aee8b7ba626b504db5d2b594bd416a3ce24254d9670047216c92290cc023c578c8cb83ab4cce952f6dc568055ca00a7707b8ef27
7
+ data.tar.gz: 44d7b64362ef7fd1fbf97e588c3048f249610f6613d3517ad3aa8a78f31447c93dd52ee2fa9fde84f84dc602620c1fa78081e29d96e78c43f327527f683ac953
@@ -0,0 +1,12 @@
1
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2
+
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: "github-actions"
6
+ directory: "/"
7
+ schedule:
8
+ interval: "daily"
9
+ - package-ecosystem: "bundler"
10
+ directory: "/"
11
+ schedule:
12
+ interval: "daily"
@@ -2,19 +2,19 @@ name: CI
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ master ]
5
+ branches: [ main ]
6
6
  pull_request:
7
- branches: [ master ]
7
+ branches: [ main ]
8
8
 
9
9
  jobs:
10
- rspec:
10
+ test:
11
11
  name: "rspec (ruby:${{ matrix.ruby }} sidekiq:${{ matrix.sidekiq }})"
12
12
 
13
13
  strategy:
14
14
  fail-fast: false
15
15
  matrix:
16
- ruby: [ "2.6", "2.7", "3.0" ]
17
- sidekiq: [ "5.0", "5.1", "5.2", "6.0", "6.1", "6.2", "6.3" ]
16
+ ruby: [ "2.7", "3.0", "3.1" ]
17
+ sidekiq: [ "6.0", "6.1", "6.2", "6.3", "6.4", "6.5" ]
18
18
 
19
19
  runs-on: ubuntu-latest
20
20
 
@@ -25,27 +25,28 @@ jobs:
25
25
  options: "--entrypoint redis-server"
26
26
 
27
27
  env:
28
- GEMFILE: gemfiles/sidekiq_${{ matrix.sidekiq }}.gemfile
28
+ BUNDLE_GEMFILE: gemfiles/sidekiq_${{ matrix.sidekiq }}.gemfile
29
29
 
30
30
  steps:
31
- - uses: actions/checkout@v2
31
+ - uses: actions/checkout@v3
32
32
 
33
33
  - uses: ruby/setup-ruby@v1
34
34
  with:
35
35
  ruby-version: ${{ matrix.ruby }}
36
36
  bundler-cache: true
37
37
 
38
- - run: bundle exec rspec
38
+ - name: bundle exec rspec
39
+ run: bundle exec rspec --format progress --force-colour
39
40
 
40
41
  rubocop:
41
42
  runs-on: ubuntu-latest
42
43
 
43
44
  steps:
44
- - uses: actions/checkout@v2
45
+ - uses: actions/checkout@v3
45
46
 
46
47
  - uses: ruby/setup-ruby@v1
47
48
  with:
48
- ruby-version: "2.6"
49
+ ruby-version: "2.7"
49
50
  bundler-cache: true
50
51
 
51
52
  - run: bundle exec rubocop
data/.rubocop.yml CHANGED
@@ -1,19 +1,20 @@
1
1
  require:
2
2
  - rubocop-performance
3
+ - rubocop-rake
3
4
  - rubocop-rspec
4
5
 
5
6
  inherit_from:
6
7
  - .rubocop_todo.yml
7
- - .rubocop/layout.yml
8
- - .rubocop/lint.yml
9
- - .rubocop/metrics.yml
10
- - .rubocop/performance.yml
11
- - .rubocop/rspec.yml
12
- - .rubocop/style.yml
8
+ - rubocop/layout.yml
9
+ - rubocop/lint.yml
10
+ - rubocop/metrics.yml
11
+ - rubocop/performance.yml
12
+ - rubocop/rspec.yml
13
+ - rubocop/style.yml
13
14
 
14
15
  AllCops:
15
16
  Exclude:
16
17
  - gemfiles/**/*
17
18
  - vendor/**/*
18
19
  NewCops: enable
19
- TargetRubyVersion: 2.6
20
+ TargetRubyVersion: 2.7
data/.rubocop_todo.yml CHANGED
@@ -1,12 +1,40 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-09-14 13:53:26 UTC using RuboCop version 0.90.0.
3
+ # on 2022-06-13 00:11:28 UTC using RuboCop version 1.30.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 68
9
+ # Offense count: 3
10
+ # Configuration parameters: AllowComments, AllowEmptyLambdas.
11
+ Lint/EmptyBlock:
12
+ Exclude:
13
+ - 'spec/sidekiq/throttled/middleware_spec.rb'
14
+ - 'spec/sidekiq/throttled/registry_spec.rb'
15
+
16
+ # Offense count: 2
17
+ # Configuration parameters: EnforcedStyleForLeadingUnderscores.
18
+ # SupportedStylesForLeadingUnderscores: disallowed, required, optional
19
+ Naming/MemoizedInstanceVariableName:
20
+ Exclude:
21
+ - 'lib/sidekiq/throttled/communicator.rb'
22
+ - 'lib/sidekiq/throttled/queues_pauser.rb'
23
+
24
+ # Offense count: 2
25
+ Performance/MethodObjectAsBlock:
26
+ Exclude:
27
+ - 'lib/sidekiq/throttled/queues_pauser.rb'
28
+
29
+ # Offense count: 2
30
+ # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
31
+ # Include: **/*_spec*rb*, **/spec/**/*
32
+ RSpec/FilePath:
33
+ Exclude:
34
+ - 'spec/sidekiq/throttled/web/queues_spec.rb'
35
+ - 'spec/sidekiq/throttled/web/throttled_spec.rb'
36
+
37
+ # Offense count: 69
10
38
  # Configuration parameters: .
11
39
  # SupportedStyles: have_received, receive
12
40
  RSpec/MessageSpies:
@@ -25,8 +53,16 @@ RSpec/MultipleMemoizedHelpers:
25
53
  RSpec/NestedGroups:
26
54
  Max: 5
27
55
 
28
- # Offense count: 4
56
+ # Offense count: 5
57
+ RSpec/StubbedMock:
58
+ Exclude:
59
+ - 'spec/sidekiq/throttled/expirable_list_spec.rb'
60
+ - 'spec/sidekiq/throttled/fetch_spec.rb'
61
+ - 'spec/sidekiq/throttled/queues_pauser_spec.rb'
62
+
63
+ # Offense count: 6
29
64
  RSpec/SubjectStub:
30
65
  Exclude:
31
66
  - 'spec/sidekiq/throttled/communicator_spec.rb'
67
+ - 'spec/sidekiq/throttled/fetch_spec.rb'
32
68
  - 'spec/sidekiq/throttled/queues_pauser_spec.rb'
data/Appraisals CHANGED
@@ -1,17 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise "sidekiq-5.0" do
4
- gem "sidekiq", "~> 5.0.0"
5
- end
6
-
7
- appraise "sidekiq-5.1" do
8
- gem "sidekiq", "~> 5.1.0"
9
- end
10
-
11
- appraise "sidekiq-5.2" do
12
- gem "sidekiq", "~> 5.2.0"
13
- end
14
-
15
3
  appraise "sidekiq-6.0" do
16
4
  gem "sidekiq", "~> 6.0.0"
17
5
  end
@@ -27,3 +15,11 @@ end
27
15
  appraise "sidekiq-6.3" do
28
16
  gem "sidekiq", "~> 6.3.0"
29
17
  end
18
+
19
+ appraise "sidekiq-6.4" do
20
+ gem "sidekiq", "~> 6.4.0"
21
+ end
22
+
23
+ appraise "sidekiq-6.5" do
24
+ gem "sidekiq", "~> 6.5.0"
25
+ end
data/CHANGES.md CHANGED
@@ -1,3 +1,40 @@
1
+ ## 0.16.1 (2022-06-14)
2
+
3
+ * [#2](https://github.com/ixti/sidekiq-throttled/pull/2)
4
+ Support custom ActiveJob adapters.
5
+ ([@longkt90])
6
+
7
+ * [#107](https://github.com/sensortower/sidekiq-throttled/pull/107)
8
+ Log error when key sufix extraction fails.
9
+ ([@pjungwir])
10
+
11
+ ## 0.16.0 (2022-06-13)
12
+
13
+ * Drop Ruby 2.6 support.
14
+
15
+ * Drop Sidekiq 5.X support.
16
+
17
+ * [#121](https://github.com/sensortower/sidekiq-throttled/pull/121)
18
+ Sidekiq 6.5 compatibility.
19
+ ([@hieuk09])
20
+
21
+ * [#116](https://github.com/sensortower/sidekiq-throttled/pull/116)
22
+ Unwrap ActiveJob JobWrapper
23
+ ([@holstvoogd])
24
+
25
+ * [#115](https://github.com/sensortower/sidekiq-throttled/pull/115)
26
+ Fix Redis 4.6 deprecation warnings.
27
+ ([@dbackeus])
28
+
29
+ * [#113](https://github.com/sensortower/sidekiq-throttled/pull/113)
30
+ Add Ruby 3.1 to CI.
31
+ ([@petergoldstein])
32
+
33
+ * [#103](https://github.com/sensortower/sidekiq-throttled/pull/103)
34
+ Rename Sidekiq::Throttled::Worker to Sidekiq::Throttled::Job, and alias it
35
+ as Sidekiq::Throttled::Worker.
36
+ ([@CHTJonas])
37
+
1
38
  ## 0.15.0 (2021-12-16)
2
39
 
3
40
  * [#102](https://github.com/sensortower/sidekiq-throttled/pull/102)
@@ -254,3 +291,10 @@
254
291
  [@mattiagiuffrida-st]: https://github.com/mattiagiuffrida-st
255
292
  [@baptistejub]: https://github.com/baptistejub
256
293
  [@ybiquitous]: https://github.com/ybiquitous
294
+ [@hieuk09]: https://github.com/hieuk09
295
+ [@petergoldstein]: https://github.com/petergoldstein
296
+ [@dbackeus]: https://github.com/dbackeus
297
+ [@holstvoogd]: https://github.com/holstvoogd
298
+ [@CHTJonas]: https://github.com/CHTJonas
299
+ [@pjungwir]: https://github.com/pjungwir
300
+ [@longkt90]: https://github.com/longkt90
data/Gemfile CHANGED
@@ -5,9 +5,6 @@ source "https://rubygems.org"
5
5
  gem "appraisal"
6
6
  gem "rake"
7
7
  gem "rspec"
8
- gem "rubocop", "~> 0.90.0", :require => false
9
- gem "rubocop-performance", "~> 1.8.0", :require => false
10
- gem "rubocop-rspec", "~> 1.43.2", :require => false
11
8
  gem "sidekiq"
12
9
 
13
10
  group :development do
@@ -20,13 +17,18 @@ end
20
17
  group :test do
21
18
  gem "apparition"
22
19
  gem "capybara"
23
- gem "coveralls", :require => false
24
20
  gem "puma"
25
21
  gem "rack-test"
26
- gem "simplecov"
27
22
  gem "sinatra"
28
23
  gem "timecop"
29
24
  end
30
25
 
26
+ group :lint do
27
+ gem "rubocop", :require => false
28
+ gem "rubocop-performance", :require => false
29
+ gem "rubocop-rake", :require => false
30
+ gem "rubocop-rspec", :require => false
31
+ end
32
+
31
33
  # Specify your gem's dependencies in sidekiq-throttled.gemspec
32
34
  gemspec
data/LICENSE.md CHANGED
@@ -1,5 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
+ Copyright (c) 2022 Alexey Zapparov
3
4
  Copyright (c) 2020-2021 Alexey Zapparov, SensorTower Inc.
4
5
  Copyright (c) 2015-2020 SensorTower Inc.
5
6
 
data/README.md CHANGED
@@ -1,10 +1,7 @@
1
1
  # Sidekiq::Throttled
2
2
 
3
+ [![CI Status](https://github.com/ixti/sidekiq-throttled/actions/workflows/ci.yml/badge.svg)](https://github.com/ixti/sidekiq-throttled/actions/workflows/ci.yml)
3
4
  [![Latest Version](https://badge.fury.io/rb/sidekiq-throttled.svg)](http://rubygems.org/gems/sidekiq-throttled)
4
- [![CI Status](https://github.com/sensortower/sidekiq-throttled/workflows/CI/badge.svg?branch=master)](https://github.com/sensortower/sidekiq-throttled/actions?query=workflow%3ACI+branch%3Amaster)
5
- [![Code Quality](https://codeclimate.com/github/sensortower/sidekiq-throttled.svg?branch=master)](https://codeclimate.com/github/sensortower/sidekiq-throttled)
6
- [![Code Coverage](https://coveralls.io/repos/github/sensortower/sidekiq-throttled/badge.svg?branch=master)](https://coveralls.io/github/sensortower/sidekiq-throttled?branch=master)
7
- [![API Docs Quality](http://inch-ci.org/github/sensortower/sidekiq-throttled.svg?branch=master)](http://inch-ci.org/github/sensortower/sidekiq-throttled)
8
5
  [![API Docs](https://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/sidekiq-throttled)
9
6
 
10
7
  Concurrency and threshold throttling for [Sidekiq][sidekiq].
@@ -39,13 +36,13 @@ Sidekiq::Throttled.setup!
39
36
  Load order can be an issue if you are using other Sidekiq plugins and/or middleware.
40
37
  To prevent any problems, add the `.setup!` call to the bottom of your init file.
41
38
 
42
- Once you've done that you can include `Sidekiq::Throttled::Worker` to your
39
+ Once you've done that you can include `Sidekiq::Throttled::Job` to your
43
40
  job classes and configure throttling:
44
41
 
45
42
  ``` ruby
46
- class MyWorker
47
- include Sidekiq::Worker
48
- include Sidekiq::Throttled::Worker
43
+ class MyJob
44
+ include Sidekiq::Job
45
+ include Sidekiq::Throttled::Job
49
46
 
50
47
  sidekiq_options :queue => :my_queue
51
48
 
@@ -62,15 +59,29 @@ class MyWorker
62
59
  end
63
60
  ```
64
61
 
62
+ **NOTE:** `Sidekiq::Throttled::Job` is aliased as `Sidekiq::Throttled::Worker`,
63
+ thus if you're using Sidekiq prior 6.3.0 version, or you using `Sidekiq::Worker`
64
+ naming convention, you can use the alias for consistency:
65
+
66
+ ``` ruby
67
+ class MyWorker
68
+ include Sidekiq::Worker
69
+ include Sidekiq::Throttled::Worker
70
+
71
+ # ...
72
+ end
73
+ ```
74
+
75
+
65
76
  ### Observer
66
77
 
67
78
  You can specify an observer that will be called on throttling. To do so pass an
68
79
  `:observer` option with callable object:
69
80
 
70
81
  ``` ruby
71
- class MyWorker
72
- include Sidekiq::Worker
73
- include Sidekiq::Throttled::Worker
82
+ class MyJob
83
+ include Sidekiq::Job
84
+ include Sidekiq::Throttled::Job
74
85
 
75
86
  MY_OBSERVER = lambda do |strategy, *args|
76
87
  # do something
@@ -100,9 +111,9 @@ to the job.
100
111
  You can throttle jobs dynamically with `:key_suffix` option:
101
112
 
102
113
  ``` ruby
103
- class MyWorker
104
- include Sidekiq::Worker
105
- include Sidekiq::Throttled::Worker
114
+ class MyJob
115
+ include Sidekiq::Job
116
+ include Sidekiq::Throttled::Job
106
117
 
107
118
  sidekiq_options :queue => :my_queue
108
119
 
@@ -122,9 +133,9 @@ for these values. The proc will be evaluated at the time the job is fetched
122
133
  and will receive the same arguments that are passed to the job.
123
134
 
124
135
  ``` ruby
125
- class MyWorker
126
- include Sidekiq::Worker
127
- include Sidekiq::Throttled::Worker
136
+ class MyJob
137
+ include Sidekiq::Job
138
+ include Sidekiq::Throttled::Job
128
139
 
129
140
  sidekiq_options :queue => :my_queue
130
141
 
@@ -150,9 +161,9 @@ end
150
161
  You also can use several different keys to throttle one worker.
151
162
 
152
163
  ``` ruby
153
- class MyWorker
154
- include Sidekiq::Worker
155
- include Sidekiq::Throttled::Worker
164
+ class MyJob
165
+ include Sidekiq::Job
166
+ include Sidekiq::Throttled::Job
156
167
 
157
168
  sidekiq_options :queue => :my_queue
158
169
 
@@ -230,12 +241,12 @@ end
230
241
 
231
242
  ## Supported Ruby Versions
232
243
 
233
- This library aims to support and is [tested against][travis] the following Ruby
244
+ This library aims to support and is [tested against][ci] the following Ruby
234
245
  versions:
235
246
 
236
- * Ruby 2.6.x
237
247
  * Ruby 2.7.x
238
248
  * Ruby 3.0.x
249
+ * Ruby 3.1.x
239
250
 
240
251
  If something doesn't work on one of these versions, it's a bug.
241
252
 
@@ -255,13 +266,12 @@ dropped.
255
266
 
256
267
  This library aims to support work with following [Sidekiq][sidekiq] versions:
257
268
 
258
- * Sidekiq 5.0.x
259
- * Sidekiq 5.1.x
260
- * Sidekiq 5.2.x
261
269
  * Sidekiq 6.0.x
262
270
  * Sidekiq 6.1.x
263
271
  * Sidekiq 6.2.x
264
272
  * Sidekiq 6.3.x
273
+ * Sidekiq 6.4.x
274
+ * Sidekiq 6.5.x
265
275
 
266
276
 
267
277
  ## Contributing
@@ -287,11 +297,5 @@ bundle exec rubocop # run static code analysis
287
297
  Don't forget to run `appraisal update` after any changes to `Gemfile`.
288
298
 
289
299
 
290
- ## Copyright
291
-
292
- Copyright (c) 2020-2021 Alexey Zapparov, SensorTower Inc.
293
- See LICENSE.md for further details.
294
-
295
-
296
- [travis]: http://travis-ci.org/sensortower/sidekiq-throttled
300
+ [ci]: https://github.com/ixti/sidekiq-throttled/actions/workflows/ci.yml
297
301
  [sidekiq]: https://github.com/mperham/sidekiq
data/Rakefile CHANGED
@@ -24,4 +24,4 @@ end
24
24
  default_suite = ENV["CI"] ? :spec : %i[spec rubocop]
25
25
  named_suites = { "rubocop" => :rubocop, "rspec" => :spec }
26
26
 
27
- task :default => named_suites.fetch(ENV["SUITE"], default_suite)
27
+ task :default => named_suites.fetch(ENV.fetch("SUITE", nil), default_suite)
@@ -5,9 +5,6 @@ source "https://rubygems.org"
5
5
  gem "appraisal"
6
6
  gem "rake"
7
7
  gem "rspec"
8
- gem "rubocop", "~> 0.90.0", require: false
9
- gem "rubocop-performance", "~> 1.8.0", require: false
10
- gem "rubocop-rspec", "~> 1.43.2", require: false
11
8
  gem "sidekiq", "~> 6.0.0"
12
9
 
13
10
  group :development do
@@ -20,12 +17,17 @@ end
20
17
  group :test do
21
18
  gem "apparition"
22
19
  gem "capybara"
23
- gem "coveralls", require: false
24
20
  gem "puma"
25
21
  gem "rack-test"
26
- gem "simplecov"
27
22
  gem "sinatra"
28
23
  gem "timecop"
29
24
  end
30
25
 
26
+ group :lint do
27
+ gem "rubocop", require: false
28
+ gem "rubocop-performance", require: false
29
+ gem "rubocop-rake", require: false
30
+ gem "rubocop-rspec", require: false
31
+ end
32
+
31
33
  gemspec path: "../"
@@ -5,9 +5,6 @@ source "https://rubygems.org"
5
5
  gem "appraisal"
6
6
  gem "rake"
7
7
  gem "rspec"
8
- gem "rubocop", "~> 0.90.0", require: false
9
- gem "rubocop-performance", "~> 1.8.0", require: false
10
- gem "rubocop-rspec", "~> 1.43.2", require: false
11
8
  gem "sidekiq", "~> 6.1.0"
12
9
 
13
10
  group :development do
@@ -20,12 +17,17 @@ end
20
17
  group :test do
21
18
  gem "apparition"
22
19
  gem "capybara"
23
- gem "coveralls", require: false
24
20
  gem "puma"
25
21
  gem "rack-test"
26
- gem "simplecov"
27
22
  gem "sinatra"
28
23
  gem "timecop"
29
24
  end
30
25
 
26
+ group :lint do
27
+ gem "rubocop", require: false
28
+ gem "rubocop-performance", require: false
29
+ gem "rubocop-rake", require: false
30
+ gem "rubocop-rspec", require: false
31
+ end
32
+
31
33
  gemspec path: "../"
@@ -5,9 +5,6 @@ source "https://rubygems.org"
5
5
  gem "appraisal"
6
6
  gem "rake"
7
7
  gem "rspec"
8
- gem "rubocop", "~> 0.90.0", require: false
9
- gem "rubocop-performance", "~> 1.8.0", require: false
10
- gem "rubocop-rspec", "~> 1.43.2", require: false
11
8
  gem "sidekiq", "~> 6.2.0"
12
9
 
13
10
  group :development do
@@ -20,12 +17,17 @@ end
20
17
  group :test do
21
18
  gem "apparition"
22
19
  gem "capybara"
23
- gem "coveralls", require: false
24
20
  gem "puma"
25
21
  gem "rack-test"
26
- gem "simplecov"
27
22
  gem "sinatra"
28
23
  gem "timecop"
29
24
  end
30
25
 
26
+ group :lint do
27
+ gem "rubocop", require: false
28
+ gem "rubocop-performance", require: false
29
+ gem "rubocop-rake", require: false
30
+ gem "rubocop-rspec", require: false
31
+ end
32
+
31
33
  gemspec path: "../"
@@ -5,9 +5,6 @@ source "https://rubygems.org"
5
5
  gem "appraisal"
6
6
  gem "rake"
7
7
  gem "rspec"
8
- gem "rubocop", "~> 0.90.0", require: false
9
- gem "rubocop-performance", "~> 1.8.0", require: false
10
- gem "rubocop-rspec", "~> 1.43.2", require: false
11
8
  gem "sidekiq", "~> 6.3.0"
12
9
 
13
10
  group :development do
@@ -20,12 +17,17 @@ end
20
17
  group :test do
21
18
  gem "apparition"
22
19
  gem "capybara"
23
- gem "coveralls", require: false
24
20
  gem "puma"
25
21
  gem "rack-test"
26
- gem "simplecov"
27
22
  gem "sinatra"
28
23
  gem "timecop"
29
24
  end
30
25
 
26
+ group :lint do
27
+ gem "rubocop", require: false
28
+ gem "rubocop-performance", require: false
29
+ gem "rubocop-rake", require: false
30
+ gem "rubocop-rspec", require: false
31
+ end
32
+
31
33
  gemspec path: "../"
@@ -5,10 +5,7 @@ source "https://rubygems.org"
5
5
  gem "appraisal"
6
6
  gem "rake"
7
7
  gem "rspec"
8
- gem "rubocop", "~> 0.90.0", require: false
9
- gem "rubocop-performance", "~> 1.8.0", require: false
10
- gem "rubocop-rspec", "~> 1.43.2", require: false
11
- gem "sidekiq", "~> 5.2.0"
8
+ gem "sidekiq", "~> 6.4.0"
12
9
 
13
10
  group :development do
14
11
  gem "byebug"
@@ -20,12 +17,17 @@ end
20
17
  group :test do
21
18
  gem "apparition"
22
19
  gem "capybara"
23
- gem "coveralls", require: false
24
20
  gem "puma"
25
21
  gem "rack-test"
26
- gem "simplecov"
27
22
  gem "sinatra"
28
23
  gem "timecop"
29
24
  end
30
25
 
26
+ group :lint do
27
+ gem "rubocop", require: false
28
+ gem "rubocop-performance", require: false
29
+ gem "rubocop-rake", require: false
30
+ gem "rubocop-rspec", require: false
31
+ end
32
+
31
33
  gemspec path: "../"
@@ -5,10 +5,7 @@ source "https://rubygems.org"
5
5
  gem "appraisal"
6
6
  gem "rake"
7
7
  gem "rspec"
8
- gem "rubocop", "~> 0.90.0", require: false
9
- gem "rubocop-performance", "~> 1.8.0", require: false
10
- gem "rubocop-rspec", "~> 1.43.2", require: false
11
- gem "sidekiq", "~> 5.1.0"
8
+ gem "sidekiq", "~> 6.5.0"
12
9
 
13
10
  group :development do
14
11
  gem "byebug"
@@ -20,12 +17,17 @@ end
20
17
  group :test do
21
18
  gem "apparition"
22
19
  gem "capybara"
23
- gem "coveralls", require: false
24
20
  gem "puma"
25
21
  gem "rack-test"
26
- gem "simplecov"
27
22
  gem "sinatra"
28
23
  gem "timecop"
29
24
  end
30
25
 
26
+ group :lint do
27
+ gem "rubocop", require: false
28
+ gem "rubocop-performance", require: false
29
+ gem "rubocop-rake", require: false
30
+ gem "rubocop-rspec", require: false
31
+ end
32
+
31
33
  gemspec path: "../"
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "fiber"
4
4
 
5
- require "sidekiq/exception_handler"
5
+ require "sidekiq/throttled/communicator/exception_handler"
6
6
 
7
7
  module Sidekiq
8
8
  module Throttled
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sidekiq"
4
+ require "sidekiq/version"
5
+
6
+ module Sidekiq
7
+ module Throttled
8
+ class Communicator
9
+ if Sidekiq::VERSION >= "6.5.0"
10
+ module ExceptionHandler
11
+ def handle_exception(*args)
12
+ Sidekiq.handle_exception(*args)
13
+ end
14
+ end
15
+
16
+ # NOTE: `Sidekiq.default_error_handler` is private API
17
+ Sidekiq.error_handlers << Sidekiq.method(:default_error_handler)
18
+ else
19
+ require "sidekiq/exception_handler"
20
+
21
+ ExceptionHandler = ::Sidekiq::ExceptionHandler
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "sidekiq/exception_handler"
3
+ require "sidekiq/throttled/communicator/exception_handler"
4
4
 
5
5
  module Sidekiq
6
6
  module Throttled