From 9ea91909c20f584f778f08dc2577bfcc7bff1e36 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sat, 25 Aug 2018 22:13:09 +0530 Subject: [PATCH] Add CPP flags --- src/Application.hs | 3 +++ src/Stackage/Database/Cron.hs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Application.hs b/src/Application.hs index 041f850..88c2c71 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -1,4 +1,5 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} +{-# LANGUAGE CPP#-} module Application ( getApplicationDev , appMain @@ -81,7 +82,9 @@ makeApplication foundation = do appPlain <- toWaiAppPlain foundation let middleware = id -- prometheus def +#if !DEVELOPMENT . forceSSL' (appSettings foundation) +#endif . logWare . defaultMiddlewaresNoLogging diff --git a/src/Stackage/Database/Cron.hs b/src/Stackage/Database/Cron.hs index adafc4c..d2523b5 100644 --- a/src/Stackage/Database/Cron.hs +++ b/src/Stackage/Database/Cron.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP#-} module Stackage.Database.Cron ( stackageServerCron , newHoogleLocker @@ -107,6 +108,7 @@ stackageServerCron = do } createStackageDatabase dbfp +#if !DEVELOPMENT db <- openStackageDatabase dbfp do @@ -139,6 +141,7 @@ stackageServerCron = do let dest = unpack key createDirectoryIfMissing True $ takeDirectory dest renamePath fp dest +#endif createHoogleDB :: StackageDatabase -> Manager -> SnapName -> IO (Maybe FilePath) createHoogleDB db man name = handleAny (\e -> print e $> Nothing) $ do