sidekiq-throttled 1.1.0 → 1.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31c4673002a4919f71a18009e82812f21a777d241072bc095994e4a67662a49e
4
- data.tar.gz: fa2c768c9ea4b023e16864c77eabe4949e9e3301a20aab5cdb5acdbdd3de9702
3
+ metadata.gz: 6a187d7a0ab7f55794f909da549082fb32ec06acca0e75928fa970fd2312a63e
4
+ data.tar.gz: c6acd8c1ebe40741e0285e6de82c0384b60a7a03ccee602b8de29309cb8bc313
5
5
  SHA512:
6
- metadata.gz: 636e41cc593e6f164061ff901ab6dab4eba7c65acf1bb41febbca13be55e9336bd86413ac50db80469429ff3bd8d9eaccd62b4e9f397a7692c184c7c70f0b98f
7
- data.tar.gz: 7055289ad5e059da619ede7c4d9ec73876894dc4a3913851e55e256e81be9bb08c3671199c81eafaf6865fe50b0f60ad670fa2e74460de45c89b20af9514a90e
6
+ metadata.gz: 6f777dff16dc389b43a089c4e392228afc695830bea0bedb4a4aa4b04d49b44a0ae5b60d643a255548947f90eeb198aaf91219f9f282de29b8c7c009626e6e4f
7
+ data.tar.gz: 86b28f4fa073f7930254269e766576da4bf3412a262d9e0329285221b1376437dc6f072e9aa93be1402da7e06f3f5501ce416b241d134c666546ae3abb7397fe
data/README.adoc CHANGED
@@ -12,11 +12,7 @@
12
12
  {doc-link}[image:{doc-badge}[API Documentation]]
13
13
  ****
14
14
 
15
- NOTE: This is the 1.x *development* branch. For the 0.x *stable* branch, please
16
- see: https://github.com/ixti/sidekiq-throttled/tree/0-x-stable[0-x-stable]
17
-
18
- Concurrency and threshold throttling for https://github.com/mperham/sidekiq[Sidekiq].
19
-
15
+ Concurrency and threshold throttling for https://github.com/sidekiq/sidekiq[Sidekiq].
20
16
 
21
17
  == Installation
22
18
 
@@ -85,7 +81,26 @@ end
85
81
  ----
86
82
 
87
83
 
88
- === Middleware(s)
84
+ === Configuration
85
+
86
+ [source,ruby]
87
+ ----
88
+ Sidekiq::Throttled.configure do |config|
89
+ # Period in seconds to exclude queue from polling in case it returned
90
+ # {config.cooldown_threshold} amount of throttled jobs in a row. Set
91
+ # this value to `nil` to disable cooldown manager completely.
92
+ # Default: 2.0
93
+ config.cooldown_period = 2.0
94
+
95
+ # Exclude queue from polling after it returned given amount of throttled
96
+ # jobs in a row.
97
+ # Default: 1 (cooldown after first throttled job)
98
+ config.cooldown_threshold = 1
99
+ end
100
+ ----
101
+
102
+
103
+ ==== Middleware(s)
89
104
 
90
105
  `Sidekiq::Throttled` relies on following bundled middlewares:
91
106
 
@@ -106,23 +121,7 @@ Sidekiq.configure_server do |config|
106
121
  end
107
122
  ----
108
123
 
109
- === Configuration
110
-
111
- [source,ruby]
112
- ----
113
- Sidekiq::Throttled.configure do |config|
114
- # Period in seconds to exclude queue from polling in case it returned
115
- # {config.cooldown_threshold} amount of throttled jobs in a row. Set
116
- # this value to `nil` to disable cooldown manager completely.
117
- # Default: 2.0
118
- config.cooldown_period = 2.0
119
-
120
- # Exclude queue from polling after it returned given amount of throttled
121
- # jobs in a row.
122
- # Default: 1 (cooldown after first throttled job)
123
- config.cooldown_threshold = 1
124
- end
125
- ----
124
+ See: https://github.com/sidekiq/sidekiq/blob/main/lib/sidekiq/middleware/chain.rb
126
125
 
127
126
 
128
127
  === Observer
@@ -268,6 +267,7 @@ sidekiq_throttle(concurrency: { limit: 20, ttl: 1.hour.to_i })
268
267
 
269
268
  This library aims to support and is tested against the following Ruby versions:
270
269
 
270
+ * Ruby 2.7.x
271
271
  * Ruby 3.0.x
272
272
  * Ruby 3.1.x
273
273
  * Ruby 3.2.x
@@ -312,3 +312,11 @@ This library aims to support and work with following Sidekiq versions:
312
312
  * Send a pull request
313
313
  * If we like them we'll merge them
314
314
  * If we've accepted a patch, feel free to ask for commit access!
315
+
316
+
317
+ == Endorsement
318
+
319
+ https://github.com/sensortower[image:sensortower.svg[SensorTower]]
320
+
321
+ The initial work on the project was initiated to address the needs of
322
+ https://github.com/sensortower[SensorTower].
@@ -15,7 +15,7 @@ module Sidekiq
15
15
  return key unless @key_suffix
16
16
 
17
17
  key << ":#{@key_suffix.call(*job_args)}"
18
- rescue => e
18
+ rescue StandardError => e
19
19
  Sidekiq.logger.error "Failed to get key suffix: #{e}"
20
20
  raise e
21
21
  end
@@ -3,6 +3,6 @@
3
3
  module Sidekiq
4
4
  module Throttled
5
5
  # Gem version
6
- VERSION = "1.1.0"
6
+ VERSION = "1.2.0"
7
7
  end
8
8
  end
@@ -85,7 +85,7 @@ module Sidekiq
85
85
  end
86
86
 
87
87
  false
88
- rescue
88
+ rescue StandardError
89
89
  false
90
90
  end
91
91
 
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: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Zapparov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-21 00:00:00.000000000 Z
11
+ date: 2023-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -87,9 +87,9 @@ licenses:
87
87
  - MIT
88
88
  metadata:
89
89
  homepage_uri: https://github.com/ixti/sidekiq-throttled
90
- source_code_uri: https://github.com/ixti/sidekiq-throttled/tree/v1.1.0
90
+ source_code_uri: https://github.com/ixti/sidekiq-throttled/tree/v1.2.0
91
91
  bug_tracker_uri: https://github.com/ixti/sidekiq-throttled/issues
92
- changelog_uri: https://github.com/ixti/sidekiq-throttled/blob/v1.1.0/CHANGES.md
92
+ changelog_uri: https://github.com/ixti/sidekiq-throttled/blob/v1.2.0/CHANGES.md
93
93
  rubygems_mfa_required: 'true'
94
94
  post_install_message:
95
95
  rdoc_options: []
@@ -99,14 +99,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: '3.0'
102
+ version: '2.7'
103
103
  required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
105
  - - ">="
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []
109
- rubygems_version: 3.4.10
109
+ rubygems_version: 3.3.26
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Concurrency and rate-limit throttling for Sidekiq