Skip to content

Commit

Permalink
Revert "Try showing less snapshots #311"
Browse files Browse the repository at this point in the history
This reverts commit 4ef23fd.
  • Loading branch information
snoyberg committed Apr 21, 2022
1 parent 3f7b642 commit f39c950
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Handler/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ getPackageSnapshotsR :: PackageNameP -> Handler Html
getPackageSnapshotsR pn =
track "Handler.Package.getPackageSnapshotsR" $ do
cacheSeconds $ 60 * 60 * 24
snapshots <- getLtsSnapshotsForPackage pn (Just 100)
snapshots <- getSnapshotsForPackage pn Nothing
defaultLayout
(do setTitle ("Packages for " >> toHtml pn)
$(combineStylesheets 'StaticR [css_font_awesome_min_css])
Expand Down
8 changes: 3 additions & 5 deletions src/Stackage/Database/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -638,17 +638,15 @@ stringToArray ::
-> SqlExpr (Value [String])
stringToArray s1 s2 = unsafeSqlFunction "string_to_array" (s1, s2)

getLtsSnapshotsForPackage
getSnapshotsForPackage
:: GetStackageDatabase env m
=> PackageNameP
-> Maybe Int
-> m [(CompilerP, SnapshotPackageInfo)]
getLtsSnapshotsForPackage pname mlimit =
getSnapshotsForPackage pname mlimit =
fmap (first unValue) <$>
run (snapshotPackageInfoQuery $ \_sp s pn _v spiQ -> do
where_ $
pn ^. PackageNameName ==. val pname &&.
(s ^. snapshotName `ilike` val "lts%")
where_ (pn ^. PackageNameName ==. val pname)
orderBy [desc (s ^. SnapshotCreated)]
forM_ mlimit (limit . fromIntegral)
pure (s ^. SnapshotCompiler, spiQ))
Expand Down

0 comments on commit f39c950

Please sign in to comment.