mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-30 04:40:24 +01:00
Remove scary "handleAny"
Simply let the process die on exception. It's a one-shot process that gets run on a timer, anyway.
This commit is contained in:
parent
885dd2a01e
commit
608cf0f4f6
@ -815,13 +815,14 @@ buildAndUploadHoogleDB doNotUpload = do
|
|||||||
uploadHoogleDB dest (ObjectKey key)
|
uploadHoogleDB dest (ObjectKey key)
|
||||||
void $ insertH snapshotId
|
void $ insertH snapshotId
|
||||||
|
|
||||||
-- | Create a hoogle db from haddocks for the given snapshot, and upload it to
|
-- | Create a hoogle db from haddocks for the given snapshot.
|
||||||
-- the haddock bucket.
|
--
|
||||||
|
-- Haddocks are downloaded from the documentation bucket, where they were
|
||||||
|
-- uploaded as a tar file.
|
||||||
|
--
|
||||||
|
-- Returns the path to the .hoo database.
|
||||||
createHoogleDB :: SnapshotId -> SnapName -> RIO StackageCron (Maybe FilePath)
|
createHoogleDB :: SnapshotId -> SnapName -> RIO StackageCron (Maybe FilePath)
|
||||||
createHoogleDB snapshotId snapName =
|
createHoogleDB snapshotId snapName = do
|
||||||
-- FIXME: this handles *any* exception, which means it will swallow most
|
|
||||||
-- signals
|
|
||||||
handleAny logException $ do
|
|
||||||
logInfo $ "Creating Hoogle DB for " <> display snapName
|
logInfo $ "Creating Hoogle DB for " <> display snapName
|
||||||
downloadBucketUrl <- scDownloadBucketUrl <$> ask
|
downloadBucketUrl <- scDownloadBucketUrl <$> ask
|
||||||
let root = "hoogle-gen"
|
let root = "hoogle-gen"
|
||||||
@ -858,10 +859,6 @@ createHoogleDB snapshotId snapName =
|
|||||||
liftIO $ Hoogle.hoogle args
|
liftIO $ Hoogle.hoogle args
|
||||||
logInfo "Merge done"
|
logInfo "Merge done"
|
||||||
return $ Just outname
|
return $ Just outname
|
||||||
where
|
|
||||||
logException exc =
|
|
||||||
logError ("Problem creating hoogle db for " <> display snapName <> ": " <> displayShow exc) $>
|
|
||||||
Nothing
|
|
||||||
|
|
||||||
|
|
||||||
-- | Grabs hoogle txt file from the tarball and a matching cabal file from pantry. Writes
|
-- | Grabs hoogle txt file from the tarball and a matching cabal file from pantry. Writes
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user