mirror of
https://github.com/ditkrg/idempotent-request.git
synced 2026-01-22 22:06:44 +00:00
Update readme with a config of conflict_response_code
This commit is contained in:
parent
4900c3af68
commit
e4c882b0bc
@ -109,7 +109,8 @@ config.middleware.use IdempotentRequest::Middleware,
|
|||||||
header_key: 'X-Qonto-Idempotency-Key', # by default Idempotency-key
|
header_key: 'X-Qonto-Idempotency-Key', # by default Idempotency-key
|
||||||
policy: IdempotentRequest::Policy,
|
policy: IdempotentRequest::Policy,
|
||||||
callback: IdempotentRequest::RailsCallback,
|
callback: IdempotentRequest::RailsCallback,
|
||||||
storage: IdempotentRequest::RedisStorage.new(::Redis.current, expire_time: 1.day, namespace: 'idempotency_keys')
|
storage: IdempotentRequest::RedisStorage.new(::Redis.current, expire_time: 1.day, namespace: 'idempotency_keys'),
|
||||||
|
conflict_response_status: 409
|
||||||
```
|
```
|
||||||
|
|
||||||
### Policy
|
### Policy
|
||||||
@ -134,7 +135,7 @@ end
|
|||||||
|
|
||||||
### Callback
|
### Callback
|
||||||
|
|
||||||
Get notified when the client sends a request with the same idempotency key:
|
Get notified when a client sends a request with the same idempotency key:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class RailsCallback
|
class RailsCallback
|
||||||
@ -150,6 +151,10 @@ class RailsCallback
|
|||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Conflict response status
|
||||||
|
|
||||||
|
Define http status code that should be returned when a client sends concurrent requests with the same idempotency key.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/idempotent-request. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/idempotent-request. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user