mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-02-05 23:57:28 +01:00
Revert "TEMP: gut out expensive queries"
This reverts commit 220a57da4c.
I just tested this against the live database, and everything seems to
work now.
This commit is contained in:
parent
6eb463f20c
commit
fbbf169e58
@ -102,7 +102,7 @@ handlePackage epi = do
|
|||||||
in if ms == authors
|
in if ms == authors
|
||||||
then []
|
then []
|
||||||
else ms
|
else ms
|
||||||
mdisplayedVersion = Nothing
|
mdisplayedVersion = msppi >>= sppiVersion
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
setTitle $ toHtml pname
|
setTitle $ toHtml pname
|
||||||
$(combineScripts 'StaticR [js_highlight_js])
|
$(combineScripts 'StaticR [js_highlight_js])
|
||||||
|
|||||||
@ -503,6 +503,7 @@ getSnapshotPackagePageInfoQuery spi maxDisplayedDeps = do
|
|||||||
if reverseDepsCount > 0
|
if reverseDepsCount > 0
|
||||||
then getReverseDeps spi (Just maxDisplayedDeps)
|
then getReverseDeps spi (Just maxDisplayedDeps)
|
||||||
else pure []
|
else pure []
|
||||||
|
latestInfo <- getLatests (spiPackageName spi)
|
||||||
moduleNames <- getModuleNames (spiSnapshotPackageId spi)
|
moduleNames <- getModuleNames (spiSnapshotPackageId spi)
|
||||||
mcabalBlobKey <- traverse getBlobKey $ spiCabalBlobId spi
|
mcabalBlobKey <- traverse getBlobKey $ spiCabalBlobId spi
|
||||||
pure
|
pure
|
||||||
@ -513,6 +514,7 @@ getSnapshotPackagePageInfoQuery spi maxDisplayedDeps = do
|
|||||||
, sppiForwardDepsCount = forwardDepsCount
|
, sppiForwardDepsCount = forwardDepsCount
|
||||||
, sppiReverseDeps = map (first dropVersionRev) reverseDeps
|
, sppiReverseDeps = map (first dropVersionRev) reverseDeps
|
||||||
, sppiReverseDepsCount = reverseDepsCount
|
, sppiReverseDepsCount = reverseDepsCount
|
||||||
|
, sppiLatestInfo = latestInfo
|
||||||
, sppiModuleNames = moduleNames
|
, sppiModuleNames = moduleNames
|
||||||
, sppiPantryCabal =
|
, sppiPantryCabal =
|
||||||
mcabalBlobKey RIO.<&> \cabalBlobKey ->
|
mcabalBlobKey RIO.<&> \cabalBlobKey ->
|
||||||
@ -521,6 +523,16 @@ getSnapshotPackagePageInfoQuery spi maxDisplayedDeps = do
|
|||||||
, pcVersion = spiVersion spi
|
, pcVersion = spiVersion spi
|
||||||
, pcCabalKey = cabalBlobKey
|
, 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
|
where
|
||||||
VersionRev curVer mcurRev = spiVersionRev spi
|
VersionRev curVer mcurRev = spiVersionRev spi
|
||||||
|
|||||||
@ -249,8 +249,11 @@ data SnapshotPackagePageInfo = SnapshotPackagePageInfo
|
|||||||
-- ^ Limited list of packages in the snapshot that depend on this package
|
-- ^ Limited list of packages in the snapshot that depend on this package
|
||||||
, sppiReverseDepsCount :: !Int
|
, sppiReverseDepsCount :: !Int
|
||||||
-- ^ Count of all packages in the snapshot that depends on this package
|
-- ^ Count of all packages in the snapshot that depends on this package
|
||||||
|
, sppiLatestInfo :: ![LatestInfo]
|
||||||
, sppiModuleNames :: !(Map ModuleNameP Bool)
|
, sppiModuleNames :: !(Map ModuleNameP Bool)
|
||||||
, sppiPantryCabal :: !(Maybe PantryCabal)
|
, sppiPantryCabal :: !(Maybe PantryCabal)
|
||||||
|
, sppiVersion :: !(Maybe VersionRev)
|
||||||
|
-- ^ Version on this page. Should be present only if different from latest
|
||||||
}
|
}
|
||||||
|
|
||||||
toRevMaybe :: Revision -> Maybe Revision
|
toRevMaybe :: Revision -> Maybe Revision
|
||||||
|
|||||||
@ -24,6 +24,21 @@ $newline never
|
|||||||
#{url}
|
#{url}
|
||||||
|
|
||||||
<table>
|
<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
|
$maybe hciLatest <- mhciLatest
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">Latest on Hackage:
|
<td align="right">Latest on Hackage:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user