sidekiq-fairplay 0.0.2 → 0.0.3
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 +4 -4
- data/README.md +7 -4
- data/lib/sidekiq/fairplay/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73751d48396c6e9c645bcea222fa2d2ff431cd3b975030be8eeefdcfe19f2e98
|
4
|
+
data.tar.gz: f7b0d50c472dd079d294c93537451b95d47a7a654298be25a064a9e7d013e708
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2dcf5b7184846e368ceae0bd76b0805dc469458411018e3c85b8be1eaa619e4921e7f16bf004986b01451886cf43ff0309cda2b3327205d0b9b79bc082b356a
|
7
|
+
data.tar.gz: da24fd2f95cf95d8b7997cf627a82d5a9c456373894ec58eb91c633af0aadf337d54187512eabcbac527c658df8f2cdd25df5b329cc7f2d1eba45edc59ca3683
|
data/README.md
CHANGED
@@ -62,17 +62,20 @@ Configure the client middleware on both client and server:
|
|
62
62
|
```ruby
|
63
63
|
Sidekiq.configure_client do |config|
|
64
64
|
config.client_middleware do |chain|
|
65
|
-
chain.
|
65
|
+
chain.prepend Sidekiq::Fairplay::Middleware
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
69
|
Sidekiq.configure_server do |config|
|
70
70
|
config.client_middleware do |chain|
|
71
|
-
chain.
|
71
|
+
chain.prepend Sidekiq::Fairplay::Middleware
|
72
72
|
end
|
73
73
|
end
|
74
74
|
```
|
75
75
|
|
76
|
+
> [!TIP]
|
77
|
+
> It's best to insert the middleware at the start of the chain using the [`#prepend` method](https://github.com/sidekiq/sidekiq/blob/d6395641571eba33050d34526bf93bed92504d4d/lib/sidekiq/middleware/chain.rb#L125), as shown above. This is important because `Sidekiq::Fairplay::Middleware` runs twice: first when you attempt to enqueue the job and it gets intercepted, and again when the planner actually enqueues it. If other middlewares are placed before it, this double execution can cause subtle issues. For example, if you use `unique_for`, you must ensure that `Sidekiq::Fairplay::Middleware` comes before `Sidekiq::Enterprise::Unique::Client`; otherwise, such jobs may lock themselves out of execution.
|
78
|
+
|
76
79
|
## API
|
77
80
|
|
78
81
|
In the following example you can see all of the available configuration parameters and their meaning:
|
@@ -171,8 +174,8 @@ We use two simple Redis-backed distributed locks:
|
|
171
174
|
- Ensures only one planner per job class runs at a time.
|
172
175
|
- Not strictly necessary (the first lock already prevents most issues), but adds safety.
|
173
176
|
|
174
|
-
|
175
|
-
It's not the end of the world, but it means you probably should **optimize your `tenant_weights` logic** and/or increase the `enqueue_interval`.
|
177
|
+
> [!WARNING]
|
178
|
+
> If a planner takes longer than its `planner_lock_ttl`, multiple planners may run concurrently. It's not the end of the world, but it means you probably should **optimize your `tenant_weights` logic** and/or increase the `enqueue_interval`.
|
176
179
|
|
177
180
|
## Troubleshooting
|
178
181
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-fairplay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Baygeldin
|
@@ -153,28 +153,28 @@ dependencies:
|
|
153
153
|
name: activesupport
|
154
154
|
requirement: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
|
-
- - "
|
156
|
+
- - ">="
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '7.0'
|
159
159
|
type: :runtime
|
160
160
|
prerelease: false
|
161
161
|
version_requirements: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
|
-
- - "
|
163
|
+
- - ">="
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '7.0'
|
166
166
|
- !ruby/object:Gem::Dependency
|
167
167
|
name: sidekiq
|
168
168
|
requirement: !ruby/object:Gem::Requirement
|
169
169
|
requirements:
|
170
|
-
- - "
|
170
|
+
- - ">="
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '7.0'
|
173
173
|
type: :runtime
|
174
174
|
prerelease: false
|
175
175
|
version_requirements: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
|
-
- - "
|
177
|
+
- - ">="
|
178
178
|
- !ruby/object:Gem::Version
|
179
179
|
version: '7.0'
|
180
180
|
email:
|