mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-02-02 14:20:25 +01:00
Re-enable view generation
This commit is contained in:
parent
38850dfe68
commit
1d49985c37
@ -37,6 +37,7 @@ import Yesod.Default.Main
|
|||||||
import System.Environment (getEnvironment)
|
import System.Environment (getEnvironment)
|
||||||
import Data.BlobStore (HasBlobStore (..), BlobStore)
|
import Data.BlobStore (HasBlobStore (..), BlobStore)
|
||||||
import System.IO (hSetBuffering, BufferMode (LineBuffering))
|
import System.IO (hSetBuffering, BufferMode (LineBuffering))
|
||||||
|
import qualified Data.ByteString as S
|
||||||
|
|
||||||
import qualified Echo
|
import qualified Echo
|
||||||
|
|
||||||
@ -230,7 +231,7 @@ cabalLoaderMain = do
|
|||||||
pool
|
pool
|
||||||
where
|
where
|
||||||
logFunc loc src level str
|
logFunc loc src level str
|
||||||
| level > LevelDebug = hPutStrLn stdout $ fromLogStr $ defaultLogStr loc src level str
|
| level > LevelDebug = S.hPutStr stdout $ fromLogStr $ defaultLogStr loc src level str
|
||||||
| otherwise = return ()
|
| otherwise = return ()
|
||||||
|
|
||||||
appLoadCabalFiles :: ( PersistConfig c
|
appLoadCabalFiles :: ( PersistConfig c
|
||||||
@ -264,18 +265,18 @@ appLoadCabalFiles env dbconf p = do
|
|||||||
runDB' $ forM_ newMD $ \x -> do
|
runDB' $ forM_ newMD $ \x -> do
|
||||||
deleteBy $ UniqueMetadata $ metadataName x
|
deleteBy $ UniqueMetadata $ metadataName x
|
||||||
insert_ x
|
insert_ x
|
||||||
{-
|
|
||||||
let views =
|
let views =
|
||||||
[ ("pvp", viewPVP uploadHistory)
|
[ ("pvp", viewPVP uploadHistory)
|
||||||
, ("no-bounds", viewNoBounds)
|
, ("no-bounds", viewNoBounds)
|
||||||
, ("unchanged", viewUnchanged)
|
, ("unchanged", viewUnchanged)
|
||||||
]
|
]
|
||||||
forM_ views $ \(name, func) -> runResourceT $ createView
|
forM_ views $ \(name, func) -> do
|
||||||
|
$logInfo $ "Generating view: " ++ toPathPiece name
|
||||||
|
runResourceT $ createView
|
||||||
name
|
name
|
||||||
func
|
func
|
||||||
(sourceHistory uploadHistory)
|
(sourceHistory uploadHistory)
|
||||||
(storeWrite $ HackageViewIndex name)
|
(storeWrite $ HackageViewIndex name)
|
||||||
-}
|
|
||||||
case eres of
|
case eres of
|
||||||
Left e -> $logError $ tshow e
|
Left e -> $logError $ tshow e
|
||||||
Right () -> return ()
|
Right () -> return ()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user