tesla v1.2.1 Tesla.Middleware.Retry View Source

Retry few times in case of connection error (nxdomain, connrefused etc). This middleware will NOT retry in case of application error (HTTP status 5xx).

Example

defmodule MyClient do
  use Tesla

  plug Tesla.Middleware.Retry, delay: 500, max_retries: 10
end

Options

  • :delay - number of milliseconds to wait before retrying (defaults to 1000)
  • :max_retries - maximum number of retries (defaults to 5)

Link to this section Summary

Link to this section Functions

Callback implementation for Tesla.Middleware.call/3.