hal 0.4.1 → 0.4.2
raw patch · 2 files changed
+13/−6 lines, 2 filesdep ~aesondep ~bytestringdep ~containersPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, bytestring, containers, envy, exceptions, http-conduit, http-types, mtl, text, time
API changes (from Hackage documentation)
Files
- hal.cabal +3/−3
- src/AWS/Lambda/RuntimeClient.hs +10/−3
hal.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.2.+-- This file has been generated from package.yaml by hpack version 0.33.0. -- -- see: https://github.com/sol/hpack ----- hash: 9ccf40a0ac9a96704caf7e69886eb5b1c146bf3bbb30cb8d886286db22f19ce3+-- hash: 789cfae834b1d0da77c93653f25855ac1f79b2443d5fdeaf2f300037c3348ccb name: hal-version: 0.4.1+version: 0.4.2 synopsis: A runtime environment for Haskell applications running on AWS Lambda. description: This library uniquely supports different types of AWS Lambda Handlers for your needs/comfort with advanced Haskell. Instead of exposing a single function
src/AWS/Lambda/RuntimeClient.hs view
@@ -31,7 +31,7 @@ setRequestCheckStatus, setRequestHeader, setRequestMethod, setRequestPath)-import Network.HTTP.Types.Status (status413, statusIsSuccessful)+import Network.HTTP.Types.Status (status403, status413, statusIsSuccessful) import System.Environment (getEnv) -- | Lambda runtime error that we pass back to AWS@@ -112,9 +112,16 @@ runtimeClientRetryTry' 1 f = try f runtimeClientRetryTry' i f = do resOrEx <- try f+ let retry = threadDelay 500 >> runtimeClientRetryTry' (i - 1) f case resOrEx of- Left (_ :: HttpException) -> threadDelay 500 >> runtimeClientRetryTry' (i - 1) f- Right res -> return $ Right res+ Left (_ :: HttpException) -> retry+ Right res ->+ -- TODO: Explore this further.+ -- Before ~July 22nd 2020 it seemed that if a next event request reached+ -- the runtime before a new event was available that there would be a+ -- network error. After it appears that a 403 is returned.+ if getResponseStatus res == status403 then retry+ else return $ Right res runtimeClientRetryTry :: IO (Response a) -> IO (Either HttpException (Response a)) runtimeClientRetryTry = runtimeClientRetryTry' 3