TEMP: gut out expensive queries

This commit is contained in:
Michael Snoyman 2020-07-07 22:07:13 +03:00
parent a24d962151
commit 220a57da4c
No known key found for this signature in database
GPG Key ID: 907EAE2F42B52046
4 changed files with 1 additions and 31 deletions

View File

@ -100,7 +100,7 @@ handlePackage epi = do
in if ms == authors
then []
else ms
mdisplayedVersion = msppi >>= sppiVersion
mdisplayedVersion = Nothing
defaultLayout $ do
setTitle $ toHtml pname
$(combineScripts 'StaticR [js_highlight_js])

View File

@ -497,7 +497,6 @@ getSnapshotPackagePageInfo spi maxDisplayedDeps =
if reverseDepsCount > 0
then getReverseDeps spi (Just maxDisplayedDeps)
else pure []
latestInfo <- getLatests (spiPackageName spi)
moduleNames <- getModuleNames (spiSnapshotPackageId spi)
mcabalBlobKey <- traverse getBlobKey $ spiCabalBlobId spi
pure
@ -508,7 +507,6 @@ getSnapshotPackagePageInfo spi maxDisplayedDeps =
, sppiForwardDepsCount = forwardDepsCount
, sppiReverseDeps = map (first dropVersionRev) reverseDeps
, sppiReverseDepsCount = reverseDepsCount
, sppiLatestInfo = latestInfo
, sppiModuleNames = moduleNames
, sppiPantryCabal =
mcabalBlobKey RIO.<&> \cabalBlobKey ->
@ -517,16 +515,6 @@ getSnapshotPackagePageInfo spi maxDisplayedDeps =
, pcVersion = spiVersion spi
, pcCabalKey = cabalBlobKey
}
, sppiVersion =
listToMaybe
[ spiVersionRev spi
| VersionRev ver mrev <-
maybe [] (pure . hciVersionRev) mhciLatest ++
map liVersionRev latestInfo
, ver > curVer ||
(ver == curVer &&
fromMaybe (Revision 0) mrev > fromMaybe (Revision 0) mcurRev)
]
}
where
VersionRev curVer mcurRev = spiVersionRev spi

View File

@ -249,11 +249,8 @@ data SnapshotPackagePageInfo = SnapshotPackagePageInfo
-- ^ Limited list of packages in the snapshot that depend on this package
, sppiReverseDepsCount :: !Int
-- ^ Count of all packages in the snapshot that depends on this package
, sppiLatestInfo :: ![LatestInfo]
, sppiModuleNames :: !(Map ModuleNameP Bool)
, sppiPantryCabal :: !(Maybe PantryCabal)
, sppiVersion :: !(Maybe VersionRev)
-- ^ Version on this page. Should be present only if different from latest
}
toRevMaybe :: Revision -> Maybe Revision

View File

@ -24,21 +24,6 @@ $newline never
#{url}
<table>
$maybe displayedVersion <- mdisplayedVersion
<tr>
<td align=right>Version on this page:
<td>
<span .version>#{displayedVersion}
$maybe sppi <- msppi
$forall li <- sppiLatestInfo sppi
<tr>
<td align="right">
<a href=@{SnapshotR (liSnapName li) StackageHomeR}>
#{snapshotPrettyNameShort (liSnapName li)}
:
<td>
<span .version>
<a href=@{SnapshotR (liSnapName li) (StackageSdistR (PNVName pname))}>#{liVersionRev li}
$maybe hciLatest <- mhciLatest
<tr>
<td align="right">Latest on Hackage: