sidekiq-throttled 0.16.0 → 0.16.1

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: 149c9477c7a02b5a8a48fd0f9d1a665c1cd254a2b5af92c82bb0bbcda92c7907
4
- data.tar.gz: 2fe05d0217edbdb5e9a66fdbd29149824ba5623d5c2e5d5df2db269d4a003bfc
3
+ metadata.gz: 51d312add58d0286d72087cefbdd49eac85a07c5416034e731f5c755f9fe702a
4
+ data.tar.gz: f7774ca65a0a26bb499dde8e34622d9e055b5112009228637a1f4b7696ad44bc
5
5
  SHA512:
6
- metadata.gz: 165176da74bbeaa33d3f882c8cac2f61e1796184dfcfedb737a9604d49cad86d20c1a9b7a19c8272a7302164825036bcea3a0a2dc78c0312db7dd1ac19f5c64a
7
- data.tar.gz: 6db474ddc907ee5c97d3b9eb829a338c9a28d5997346031864cbfcda00857a24b49ae36451f92bf112d0985065bbf72443313733bc13075c8e1ebdcab6465c70
6
+ metadata.gz: 0e7170c5e6dbe4a5664523ab04794b2f921296c690fbac05e6a2966bc0285612374441ec86d561cf48a45d36369c8c2fe0154c99aa2b9ed347cec642a0c4d22a
7
+ data.tar.gz: a7c8ff62bb1ff8e09f609f8d341ab57539e3db8aa8112c29d09f052b487310c5969e98c5e80c5cc6f1b4e1dbd13a278f7d117bb4ff13e28ee0e2f75743044b74
@@ -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"
@@ -28,7 +28,7 @@ jobs:
28
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:
@@ -42,7 +42,7 @@ jobs:
42
42
  runs-on: ubuntu-latest
43
43
 
44
44
  steps:
45
- - uses: actions/checkout@v2
45
+ - uses: actions/checkout@v3
46
46
 
47
47
  - uses: ruby/setup-ruby@v1
48
48
  with:
data/CHANGES.md CHANGED
@@ -1,3 +1,13 @@
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
+
1
11
  ## 0.16.0 (2022-06-13)
2
12
 
3
13
  * Drop Ruby 2.6 support.
@@ -286,3 +296,5 @@
286
296
  [@dbackeus]: https://github.com/dbackeus
287
297
  [@holstvoogd]: https://github.com/holstvoogd
288
298
  [@CHTJonas]: https://github.com/CHTJonas
299
+ [@pjungwir]: https://github.com/pjungwir
300
+ [@longkt90]: https://github.com/longkt90
@@ -12,8 +12,12 @@ module Sidekiq
12
12
 
13
13
  def key(job_args)
14
14
  key = @base_key.dup
15
- key << ":#{@key_suffix.call(*job_args)}" if @key_suffix
16
- key
15
+ return key unless @key_suffix
16
+
17
+ key << ":#{@key_suffix.call(*job_args)}"
18
+ rescue => e
19
+ Sidekiq.logger.error "Failed to get key suffix: #{e}"
20
+ raise e
17
21
  end
18
22
  end
19
23
  end
@@ -3,6 +3,6 @@
3
3
  module Sidekiq
4
4
  module Throttled
5
5
  # Gem version
6
- VERSION = "0.16.0"
6
+ VERSION = "0.16.1"
7
7
  end
8
8
  end
@@ -75,11 +75,10 @@ module Sidekiq
75
75
  #
76
76
  # @param [String] message Job's JSON payload
77
77
  # @return [Boolean]
78
- def throttled?(message) # rubocop:disable Metrics/MethodLength
78
+ def throttled?(message)
79
79
  message = JSON.parse message
80
- job = message.fetch("class") { return false }
81
- job = message.fetch("wrapped") { return false } if job == "ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper"
82
- jid = message.fetch("jid") { return false }
80
+ job = message.fetch("wrapped") { message.fetch("class") { return false } }
81
+ jid = message.fetch("jid") { return false }
83
82
 
84
83
  preload_constant! job
85
84
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-throttled
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Zapparov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-13 00:00:00.000000000 Z
11
+ date: 2022-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -74,6 +74,7 @@ extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - ".coveralls.yml"
77
+ - ".github/dependabot.yml"
77
78
  - ".github/workflows/ci.yml"
78
79
  - ".gitignore"
79
80
  - ".rspec"