Force using only latest Hoogle DBs

This commit is contained in:
Michael Snoyman 2020-09-02 17:39:52 +03:00
parent 4e7e62c3dc
commit 68fa14a4bb
No known key found for this signature in database
GPG Key ID: 907EAE2F42B52046
2 changed files with 7 additions and 1 deletions

View File

@ -23,7 +23,12 @@ getHoogleDB name = track "Handler.Hoogle.getHoogleDB" do
liftIO $ appGetHoogleDB app name
getHoogleR :: SnapName -> Handler Html
getHoogleR name = track "Handler.Hoogle.getHoogleR" do
getHoogleR name0 = track "Handler.Hoogle.getHoogleR" do
let branch =
case name0 of
SNLts _ _ -> LtsBranch
SNNightly _ -> NightlyBranch
name <- newestSnapshot branch >>= maybe notFound return
Entity _ snapshot <- lookupSnapshot name >>= maybe notFound return
mquery <- lookupGetParam "q"
mPackageName <- lookupGetParam "package"

View File

@ -229,6 +229,7 @@ runStackageUpdate doNotUpload = do
runConduit $ sourceSnapshots .| foldMC (createOrUpdateSnapshot corePackageGetters) (pure ())
unless doNotUpload uploadSnapshotsJSON
buildAndUploadHoogleDB doNotUpload
logInfo "Finished building and uploading Hoogle DBs"
run $ mapM_ (`rawExecute` []) ["TRUNCATE TABLE latest_version", "COMMIT", "VACUUM", "BEGIN"]