diff --git a/.ghci b/.ghci index 7b54b0e..036bc7a 100755 --- a/.ghci +++ b/.ghci @@ -2,4 +2,5 @@ :set -i.:config:dist/build/autogen :set -XCPP -XTemplateHaskell -XQuasiQuotes -XTypeFamilies -XFlexibleContexts -XGADTs -XOverloadedStrings -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving -XEmptyDataDecls -XDeriveDataTypeable -XRankNTypes -XNoImplicitPrelude -XFunctionalDependencies -XFlexibleInstances -XTemplateHaskell -XQuasiQuotes -XOverloadedStrings -XNoImplicitPrelude -XCPP -XMultiParamTypeClasses -XTypeFamilies -XGADTs -XGeneralizedNewtypeDeriving -XFlexibleContexts -XEmptyDataDecls -XNoMonomorphismRestriction -XDeriveDataTypeable -XViewPatterns -XTypeSynonymInstances -XFlexibleInstances -XRankNTypes -XFunctionalDependencies -XPatternGuards -XStandaloneDeriving -XUndecidableInstances :set -DDEVELOPMENT=1 +:set -DINGHCI=1 :set -package foreign-store diff --git a/Application.hs b/Application.hs index 03f3c0e..a9ab830 100644 --- a/Application.hs +++ b/Application.hs @@ -152,7 +152,7 @@ makeFoundation useEcho conf = do (messageLoggerSource foundation logger) -- Start the cabal file loader - void $ forkIO $ forever $ flip runLoggingT (messageLoggerSource foundation logger) $ do + ifRunCabalLoader $ forkIO $ forever $ flip runLoggingT (messageLoggerSource foundation logger) $ do $logInfoS "CLEANUP" "Cleaning up /tmp" now <- liftIO getCurrentTime runResourceT $ sourceDirectory "/tmp" $$ mapM_C (cleanupTemp now) @@ -182,6 +182,10 @@ makeFoundation useEcho conf = do Right () -> return () liftIO $ threadDelay $ 30 * 60 * 1000000 return foundation + where ifRunCabalLoader m = + if cabalFileLoader + then void m + else return () cleanupTemp :: UTCTime -> FilePath -> ResourceT (LoggingT IO) () cleanupTemp now fp diff --git a/Settings/Development.hs b/Settings/Development.hs index 73613f0..b186280 100644 --- a/Settings/Development.hs +++ b/Settings/Development.hs @@ -10,5 +10,13 @@ development = False #endif +cabalFileLoader :: Bool +cabalFileLoader = +#if INGHCI + False +#else + True +#endif + production :: Bool production = not development