diff --git a/src/Application.hs b/src/Application.hs index 94e5a97..93001cf 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -160,7 +160,6 @@ withFoundation appLogFunc appSettings inner = do \oldMatcher -> getLatestMatcher appHttpManager `catchAny` \e -> do runRIO appLogFunc $ RIO.logError $ "Couldn't get Stack matcher: " <> displayShow e pure oldMatcher - appHoogleLock <- newMVar () appMirrorStatus <- mkUpdateMirrorStatus hoogleLocker <- newHoogleLocker appLogFunc appHttpManager let appGetHoogleDB = singleRun hoogleLocker diff --git a/src/Foundation.hs b/src/Foundation.hs index 0aa8015..e4b244a 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -35,9 +35,6 @@ data App = App , appStackageDatabase :: !StackageDatabase , appLatestStackMatcher :: !(IO (Text -> Maybe Text)) -- ^ Give a pattern, get a URL - , appHoogleLock :: !(MVar ()) - -- ^ Avoid concurrent Hoogle queries, see - -- https://github.com/fpco/stackage-server/issues/172 , appMirrorStatus :: !(IO (Status, WidgetFor App ())) , appGetHoogleDB :: !(SnapName -> IO (Maybe FilePath)) , appGitRev :: !GitRev diff --git a/src/Handler/Hoogle.hs b/src/Handler/Hoogle.hs index fd3cc92..488779a 100644 --- a/src/Handler/Hoogle.hs +++ b/src/Handler/Hoogle.hs @@ -47,9 +47,6 @@ getHoogleR name0 = track "Handler.Hoogle.getHoogleR" do mdatabasePath <- getHoogleDB name dbPath <- maybe (hoogleDatabaseNotAvailableFor name) return mdatabasePath - -- Avoid concurrent Hoogle queries, see - -- https://github.com/fpco/stackage-server/issues/172 - lock <- appHoogleLock <$> getYesod urlRender <- getUrlRender HoogleQueryOutput results mtotalCount <- case mquery of @@ -64,9 +61,7 @@ getHoogleR name0 = track "Handler.Hoogle.getHoogleR" do , hqiExact = exact } - liftIO $ withMVar lock - $ const - $ Hoogle.withDatabase dbPath + liftIO $ Hoogle.withDatabase dbPath -- NB! I got a segfault when I didn't force with $! $ \db -> return $! runHoogleQuery urlRender name db input Nothing -> return $ HoogleQueryOutput [] Nothing