Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dynamo retry handler #58

Open
nhibberd opened this issue Feb 19, 2019 · 0 comments
Open

Add dynamo retry handler #58

nhibberd opened this issue Feb 19, 2019 · 0 comments

Comments

@nhibberd
Copy link
Owner

-- https://github.com/brendanhay/amazonka/issues/351
configureRetries :: Env -> Env
configureRetries env =
  let
    check e =
      let
        check' = dynamoDB ^. serviceRetry . retryCheck
      in
        case check' e of
          Nothing ->
            case has (hasCode "ProvisionedThroughputExceeded" . hasStatus 400) e of
              True ->
                Just "throughput_exceeded_x"
              False ->
                Nothing
          Just x ->
            Just x
  in
    flip configure env .
      flip (over serviceRetry) dynamoDB $
          set retryAttempts 7 .
          set exponentBase 0.6 .
          set retryCheck check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant