digitalocean/droplet_kit

Faraday's retry configuration is not exposed

stavxyz opened this issue · 1 comments

Faraday includes a retry middleware module.

At present, droplet_kit does not expose this thus retries are not configurable unless the client's initialize and connection methods are overridden into a new client (as far as I can tell).

An enhancement here would produce an interface something like this

client = DropletKit::Client.new(
  access_token: 'YOUR_TOKEN',
  retry_exceptions: [CustomException, 'Timeout::Error'],
  retry_statuses: [500, 501]
)

# or I think I prefer this:

client = DropletKit::Client.new(
  access_token: 'YOUR_TOKEN',
  retry: {
    exceptions: [CustomException, 'Timeout::Error'],
    statuses: [500, 501]
  }
)

We're planning a thorough overhaul of droplet_kit in the near future. Retries then!