sidekiq-dry 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +14 -0
- data/README.md +3 -1
- data/lib/sidekiq/dry/server/deserialization_middleware.rb +11 -1
- data/lib/sidekiq/dry/version.rb +1 -1
- 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: c64ab9affeebd68fc36380d88605da8f76b7ac92885ae5cbc9173f5120fc7cd8
|
4
|
+
data.tar.gz: 40fd08a75380dd98d8f98d712397d1f39f37887b33a07bc21479436fa439d504
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d3533a66422beb638e784a45bee9dfffdbd6e1b12e4cc37b9cafbdcf5895a5b86c11e616e4283190f2a640cd27849f7838b17d7921e4b6bd2ae33fef6d37828
|
7
|
+
data.tar.gz: be4483f697430720a376f1b1c50dd71efea48072c8be82000828463d6e17d36fc978b146b8cad37303a08e6c3b82c096cb17157f48280a7478c243face90077c
|
data/CHANGELOG
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
+
|
5
|
+
## Unreleased
|
6
|
+
|
7
|
+
## [1.1.1] - 2020-02-24
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
* When an exception is raised, the original (before Dry::Struct deserialization) arguments
|
12
|
+
are reset so that other middlewares (think exception reporting) don't have to deal with
|
13
|
+
Dry::Struct.
|
14
|
+
|
data/README.md
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
Gem to provide serialization and deserialization of [Dry::Struct][dry-struct]
|
7
7
|
arguments for [Sidekiq][sidekiq] jobs.
|
8
8
|
|
9
|
+
Read more about this gem [here](https://zorbash.com/post/sidekiq-dry/).
|
10
|
+
|
9
11
|
## Rationale
|
10
12
|
|
11
13
|
**Argument Validation**
|
@@ -127,7 +129,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
127
129
|
|
128
130
|
## Contributing
|
129
131
|
|
130
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
132
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/zorbash/sidekiq-dry. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/zorbash/sidekiq-dry/blob/master/CODE_OF_CONDUCT.md).
|
131
133
|
|
132
134
|
|
133
135
|
## License
|
@@ -6,7 +6,9 @@ module Sidekiq
|
|
6
6
|
# Middleware which instantiates `Dry::Struct` hash arguments
|
7
7
|
class DeserializationMiddleware
|
8
8
|
def call(_worker, job, _queue)
|
9
|
-
job['args']
|
9
|
+
original_args = job['args']
|
10
|
+
|
11
|
+
job['args'] = job['args'].map do |arg|
|
10
12
|
# Only mutate Dry::Struct hashes
|
11
13
|
next arg unless struct?(arg)
|
12
14
|
|
@@ -14,6 +16,14 @@ module Sidekiq
|
|
14
16
|
end
|
15
17
|
|
16
18
|
yield
|
19
|
+
rescue Exception => _ex
|
20
|
+
# Other middlewares will see the Hash arguments
|
21
|
+
# which might be handled more predictably in cases
|
22
|
+
# like exception tracking where the job arguments
|
23
|
+
# commonly get processed to redact sensitive info
|
24
|
+
job['args'] = original_args
|
25
|
+
|
26
|
+
raise
|
17
27
|
end
|
18
28
|
|
19
29
|
private
|
data/lib/sidekiq/dry/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-dry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitris Zorbas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- ".gitignore"
|
106
106
|
- ".rspec"
|
107
107
|
- ".travis.yml"
|
108
|
+
- CHANGELOG
|
108
109
|
- CODE_OF_CONDUCT.md
|
109
110
|
- Gemfile
|
110
111
|
- Gemfile.lock
|