From 0662522a447d6dc4f421a53abe18f21d6e2995d8 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Sun, 20 May 2018 16:58:48 +0200 Subject: [PATCH] update to Stack LTS 11.9 --- Foundation.hs | 15 +++++---------- Handler/Shared.hs | 6 ++++-- gonito.cabal | 16 ++++++++-------- stack.yaml | 6 +++++- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Foundation.hs b/Foundation.hs index ed6c6a2..86f224c 100644 --- a/Foundation.hs +++ b/Foundation.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE InstanceSigs #-} + module Foundation where import Database.Persist.Sql (ConnectionPool, runSqlPool) @@ -173,13 +175,6 @@ instance Yesod App where -- Generate a unique filename based on the content itself genFileName lbs = "autogen-" ++ base64md5 lbs - -- What messages should be logged. The following includes all messages when - -- in development, and warnings and errors in production. - shouldLog app _source level = - appShouldLogAll (appSettings app) - || level == LevelWarn - || level == LevelError - makeLogger = return . appLogger -- How to run database actions. @@ -201,7 +196,9 @@ instance YesodAuth App where -- Override the above two destinations when a Referer: header is present redirectToReferer _ = True - authenticate creds = runDB $ do + authenticate :: (MonadHandler m, HandlerSite m ~ App) + => Creds App -> m (AuthenticationResult App) + authenticate creds = liftHandler $ runDB $ do x <- getBy $ UniqueUser $ credsIdent creds Authenticated <$> case x of Just (Entity uid _) -> return $ uid @@ -222,8 +219,6 @@ instance YesodAuth App where -- You can add other plugins like BrowserID, email or OAuth here authPlugins master = [authHashDBWithForm (myLoginForm master) (Just . UniqueUser)] - authHttpManager = getHttpManager - contactEmailLabel :: App -> Text contactEmailLabel site = case maybeContactMail of diff --git a/Handler/Shared.hs b/Handler/Shared.hs index de091b1..5934229 100644 --- a/Handler/Shared.hs +++ b/Handler/Shared.hs @@ -14,6 +14,7 @@ import qualified Data.Text as T import Database.Persist.Sql (ConnectionPool, runSqlPool, fromSqlKey) import Control.Concurrent.Lifted (fork, threadDelay) +import Control.Concurrent (forkIO) import qualified Crypto.Hash.SHA1 as CHS @@ -95,7 +96,8 @@ runViewProgress' route action = do m <- readTVar jobs writeTVar jobs $ IntMap.insert jobId chan m return chan - fork $ do + runInnerHandler <- handlerToIO + liftIO $ forkIO $ runInnerHandler $ do liftIO $ threadDelay 1000000 action chan liftIO $ atom $ do @@ -308,7 +310,7 @@ gatherOutput ph hout herr chan = work mempty mempty -- Read any outstanding input. resterr <- takeABit herr accerr restout <- takeABit hout accout - threadDelay 1000000 + liftIO $ threadDelay 1000000 -- Check on the process. s <- liftIO $ getProcessExitCode ph -- Exit or loop. diff --git a/gonito.cabal b/gonito.cabal index de92f07..c6e3693 100644 --- a/gonito.cabal +++ b/gonito.cabal @@ -78,25 +78,25 @@ library RecordWildCards build-depends: base >= 4 && < 5 - , yesod >= 1.4.1 && < 1.5 - , yesod-core >= 1.4.6 && < 1.5 - , yesod-auth >= 1.4.0 && < 1.5 - , yesod-static >= 1.4.0.3 && < 1.6 - , yesod-form >= 1.4.0 && < 1.5 + , yesod >= 1.6 && < 1.7 + , yesod-core >= 1.6 && < 1.7 + , yesod-auth >= 1.6 && < 1.7 + , yesod-static >= 1.6 && < 1.7 + , yesod-form >= 1.6 && < 1.7 , classy-prelude >= 0.10.2 , classy-prelude-conduit >= 0.10.2 , classy-prelude-yesod >= 0.10.2 , bytestring >= 0.9 && < 0.11 , text >= 0.11 && < 2.0 - , persistent >= 2.0 && < 2.8 - , persistent-postgresql >= 2.1.1 && < 2.7 + , persistent >= 2.0 && < 2.9 + , persistent-postgresql >= 2.1.1 && < 2.9 , persistent-template >= 2.0 && < 2.6 , template-haskell , shakespeare >= 2.0 && < 2.1 , monad-control >= 0.3 && < 1.1 , wai-extra >= 3.0 && < 3.1 , yaml >= 0.8 && < 0.9 - , http-conduit >= 2.1 && < 2.3 + , http-conduit >= 2.1 && < 2.4 , directory >= 1.1 && < 1.4 , warp >= 3.0 && < 3.3 , data-default diff --git a/stack.yaml b/stack.yaml index 36f9fdf..53de6f8 100644 --- a/stack.yaml +++ b/stack.yaml @@ -4,5 +4,9 @@ flags: dev: false packages: - '.' +- location: + git: https://github.com/bitemyapp/esqueleto + commit: b81e0d951e510ebffca03c5a58658ad884cc6fbd + extra-dep: true extra-deps: [../geval,wai-handler-fastcgi-3.0.0.2,murmur3-1.0.3] -resolver: lts-10.10 +resolver: lts-11.9