Skip to content
Snippets Groups Projects

api: Add an optional requests retry feature to the RPC client

Merged Antoine Lambert requested to merge anlambert/swh-core:rpc-client-retry-feature into master
  1. Nov 06, 2024
    • Antoine Lambert's avatar
      api: Add an optional requests retry feature to the RPC client · ce0d4b72
      Antoine Lambert authored
      Add a new enable_requests_retry flag to the swh.core.api.RPCClient
      class, default to False, allowing to retry requests sent by the
      client when encountering specific errors. Default policy is to retry
      when connection errors and transient remote exceptions are raised.
      Subclasses can change that policy by overriding the retry_policy
      method. Such failed requests will be retry at most five times with a
      delay of 10 seconds between each.
      ce0d4b72
Loading