mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-26 19:01:56 +01:00
Retry downloading the deprecated.json file
This commit is contained in:
parent
34ec0783c3
commit
bd40aeddd9
@ -90,6 +90,7 @@ dependencies:
|
|||||||
- file-embed
|
- file-embed
|
||||||
- resource-pool
|
- resource-pool
|
||||||
- containers
|
- containers
|
||||||
|
- retry
|
||||||
|
|
||||||
default-extensions:
|
default-extensions:
|
||||||
- OverloadedStrings
|
- OverloadedStrings
|
||||||
|
|||||||
@ -63,7 +63,7 @@ import Stackage.Database.Types
|
|||||||
import System.Environment (lookupEnv)
|
import System.Environment (lookupEnv)
|
||||||
import UnliftIO.Concurrent (getNumCapabilities)
|
import UnliftIO.Concurrent (getNumCapabilities)
|
||||||
import Web.PathPieces (fromPathPiece, toPathPiece)
|
import Web.PathPieces (fromPathPiece, toPathPiece)
|
||||||
|
import qualified Control.Retry as Retry
|
||||||
|
|
||||||
|
|
||||||
hoogleKey :: SnapName -> Text
|
hoogleKey :: SnapName -> Text
|
||||||
@ -143,7 +143,9 @@ newHoogleLocker env man = mkSingleRun hoogleLocker
|
|||||||
getHackageDeprecations ::
|
getHackageDeprecations ::
|
||||||
(HasLogFunc env, MonadReader env m, MonadIO m) => m [Deprecation]
|
(HasLogFunc env, MonadReader env m, MonadIO m) => m [Deprecation]
|
||||||
getHackageDeprecations = do
|
getHackageDeprecations = do
|
||||||
jsonResponseDeprecated <- httpJSONEither hackageDeprecatedUrl
|
let policy = Retry.exponentialBackoff 50 <> Retry.limitRetries 5
|
||||||
|
jsonResponseDeprecated <-
|
||||||
|
liftIO $ Retry.recoverAll policy $ const $ httpJSONEither hackageDeprecatedUrl
|
||||||
case getResponseBody jsonResponseDeprecated of
|
case getResponseBody jsonResponseDeprecated of
|
||||||
Left err -> do
|
Left err -> do
|
||||||
logError $
|
logError $
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user