antiope-core 7.5.0 → 7.5.1
raw patch · 2 files changed
+7/−5 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- antiope-core.cabal +1/−1
- src/Antiope/Env.hs +6/−4
antiope-core.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4 name: antiope-core-version: 7.5.0+version: 7.5.1 description: Please see the README on Github at <https://github.com/arbor/antiope#readme>. synopsis: Please see the README on Github at <https://github.com/arbor/antiope#readme> category: Services
src/Antiope/Env.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE OverloadedStrings #-} module Antiope.Env ( mkEnv , AWS.Env@@ -12,7 +13,6 @@ import Network.HTTP.Client (HttpException (..), HttpExceptionContent (..)) import qualified Data.ByteString as BS-import qualified Data.ByteString.Char8 as C8 import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Lazy.Internal as LBS import qualified Network.AWS as AWS@@ -27,9 +27,11 @@ newAwsLogger :: Monad m => (AWS.LogLevel -> LBS.ByteString -> IO ()) -> m AWS.Logger newAwsLogger lg = return $ \y b ->- case toLazyByteString b of- msg | BS.isInfixOf (C8.pack "404 Not Found") (L.toStrict msg) -> pure ()- msg -> lg y msg+ let lazyMsg = toLazyByteString b+ in case L.toStrict lazyMsg of+ msg | BS.isInfixOf "404 Not Found" msg -> lg AWS.Debug lazyMsg+ msg | BS.isInfixOf "304 Not Modified" msg -> lg AWS.Debug lazyMsg+ _ -> lg y lazyMsg retryPolicy :: Int -> Int -> HttpException -> Bool retryPolicy maxNum attempt ex = (attempt <= maxNum) && shouldRetry ex