Sha256: c72af12620bce5c3217443f77862c79e3672f9eb717c7b8bb0a750c752a547cb

Contents?: true

Size: 384 Bytes

Versions: 2

Compression:

Stored size: 384 Bytes

Contents

class Idempo::ConcurrentRequestErrorApp
  RETRY_AFTER_SECONDS = 2.to_s

  def self.call(env)
    res = {
      ok: false,
      error: {
        message: "Another request with this idempotency key is still in progress, please try again later"
      }
    }
    [429, {"Retry-After" => RETRY_AFTER_SECONDS, "Content-Type" => "application/json"}, [JSON.pretty_generate(res)]]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
idempo-1.2.2 lib/idempo/concurrent_request_error_app.rb
idempo-1.2.1 lib/idempo/concurrent_request_error_app.rb