From e4c882b0bca81ea46fc2e4319b16638d35e0b096 Mon Sep 17 00:00:00 2001 From: Dmytro Zakharov Date: Fri, 13 Nov 2020 15:55:19 +0100 Subject: [PATCH] Update readme with a config of conflict_response_code --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0ddb544..c5c3b3c 100644 --- a/README.md +++ b/README.md @@ -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.