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 +4 -4
- data/.github/dependabot.yml +12 -0
- data/.github/workflows/ci.yml +2 -2
- data/CHANGES.md +12 -0
- data/lib/sidekiq/throttled/strategy/base.rb +6 -2
- data/lib/sidekiq/throttled/version.rb +1 -1
- data/lib/sidekiq/throttled.rb +3 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51d312add58d0286d72087cefbdd49eac85a07c5416034e731f5c755f9fe702a
|
4
|
+
data.tar.gz: f7774ca65a0a26bb499dde8e34622d9e055b5112009228637a1f4b7696ad44bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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"
|
data/.github/workflows/ci.yml
CHANGED
@@ -28,7 +28,7 @@ jobs:
|
|
28
28
|
BUNDLE_GEMFILE: gemfiles/sidekiq_${{ matrix.sidekiq }}.gemfile
|
29
29
|
|
30
30
|
steps:
|
31
|
-
- uses: actions/checkout@
|
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@
|
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
|
16
|
-
|
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
|
data/lib/sidekiq/throttled.rb
CHANGED
@@ -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)
|
78
|
+
def throttled?(message)
|
79
79
|
message = JSON.parse message
|
80
|
-
job = message.fetch("class")
|
81
|
-
|
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.
|
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-
|
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"
|