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:
Bryan Richter 2024-11-12 16:23:43 +02:00
parent 885dd2a01e
commit 608cf0f4f6
No known key found for this signature in database
GPG Key ID: B202264020068BFB

View File

@ -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