mirror of
https://github.com/ditkrg/idempotent-request.git
synced 2026-01-22 22:06:44 +00:00
Merge branch 'update-readme-with-conflict-code'
This commit is contained in:
commit
18cda288b8
@ -109,7 +109,8 @@ config.middleware.use IdempotentRequest::Middleware,
|
||||
header_key: 'X-Qonto-Idempotency-Key', # by default Idempotency-key
|
||||
policy: IdempotentRequest::Policy,
|
||||
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
|
||||
@ -134,7 +135,7 @@ end
|
||||
|
||||
### 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
|
||||
class RailsCallback
|
||||
@ -150,6 +151,10 @@ class RailsCallback
|
||||
end
|
||||
```
|
||||
|
||||
### Conflict response status
|
||||
|
||||
Define http status code that should be returned when a client sends concurrent requests with the same idempotency key.
|
||||
|
||||
## 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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user