Remove the timeouts, hope for the best

This commit is contained in:
Michael Snoyman 2020-11-13 11:08:02 +02:00
parent dcb1485e50
commit 54e475e43e
No known key found for this signature in database
GPG Key ID: 907EAE2F42B52046

View File

@ -80,15 +80,13 @@ packagePage mspi pname =
mspi' <- mspi' <-
case mspi of case mspi of
Just spi -> pure $ Just spi Just spi -> pure $ Just spi
Nothing -> Nothing -> getSnapshotPackageLatestVersion pname
fmap join $ timeout 2000000 $ getSnapshotPackageLatestVersion pname
case mspi' of case mspi' of
Nothing -> do Nothing -> do
mmhci <- timeout 2000000 $ run $ getHackageLatestVersion pname mhci <- run $ getHackageLatestVersion pname
case mmhci of case mhci of
Nothing -> error "Getting latest version timed out" Nothing -> notFound
Just Nothing -> notFound (Just hci) -> handlePackage $ Left hci
Just (Just hci) -> handlePackage $ Left hci
Just spi -> handlePackage $ Right spi Just spi -> handlePackage $ Right spi
@ -97,14 +95,13 @@ handlePackage epi = do
(isDeprecated, inFavourOf, snapInfo, PackageInfo{..}) <- do (isDeprecated, inFavourOf, snapInfo, PackageInfo{..}) <- do
(isDeprecated, inFavourOf) <- run $ getDeprecatedQuery pname (isDeprecated, inFavourOf) <- run $ getDeprecatedQuery pname
snapInfo <- case epi of snapInfo <- case epi of
Right spi -> Right <$> timeout 2000000 (run $ getSnapshotPackagePageInfoQuery spi maxDisplayedDeps) Right spi -> Right <$> run (getSnapshotPackagePageInfoQuery spi maxDisplayedDeps)
Left hci -> pure $ Left hci Left hci -> pure $ Left hci
pinfo <- run $ getPackageInfoQuery epi pinfo <- run $ getPackageInfoQuery epi
pure (isDeprecated, inFavourOf, snapInfo, pinfo) pure (isDeprecated, inFavourOf, snapInfo, pinfo)
(msppi, mhciLatest) <- case snapInfo of (msppi, mhciLatest) <- case snapInfo of
Left hci -> pure (Nothing, Just hci) Left hci -> pure (Nothing, Just hci)
Right (Just sppi) -> pure (Just sppi, sppiLatestHackageCabalInfo sppi) Right sppi -> pure (Just sppi, sppiLatestHackageCabalInfo sppi)
Right Nothing -> pure (Nothing, Nothing)
let authors = enumerate piAuthors let authors = enumerate piAuthors
maintainers = maintainers =
let ms = enumerate piMaintainers let ms = enumerate piMaintainers