packages feed

wolf 0.3.23 → 0.3.24

raw patch · 5 files changed

+22/−16 lines, 5 filesdep ~wolf

Dependency ranges changed: wolf

Files

Shakefile.hs view
@@ -16,12 +16,12 @@ main :: IO () main = shakeMain $ do   let pats =-        [ "stack.yaml"+        [ "stack*.yaml"         , "Shakefile.hs"         , "main//*.hs"         , "src//*.hs"         ]-      pats' = delete "stack.yaml" pats+      pats' = delete "stack*.yaml" pats    -- | Haskell rules.   --
main/actor.hs view
@@ -16,6 +16,10 @@     -- ^ Configuration file.   , queue   :: Text     -- ^ Queue to listen to act on.+  , num     :: Maybe Int+    -- ^ Number of actors to run concurrently.+  , nocopy  :: Bool+    -- ^ Copy working directory.   , command :: String     -- ^ Command to run.   } deriving (Show, Generic)@@ -30,4 +34,6 @@   actMain     (config args)     (queue args)+    (fromMaybe 1 $ num args)+    (nocopy args)     (command args)
src/Network/AWS/Wolf/Act.hs view
@@ -65,8 +65,8 @@  -- | Actor logic - poll for work, download artifacts, run command, upload artifacts. ---act :: MonadConf c m => Text -> String -> m ()-act queue command =+act :: MonadConf c m => Text -> Bool -> String -> m ()+act queue nocopy command =   preConfCtx [ "label" .= LabelAct ] $     runAmazonCtx $       runAmazonWorkCtx queue $ do@@ -78,7 +78,7 @@         statsHistogram "wolf.act.poll.elapsed" (realToFrac (diffUTCTime t1 t0) :: Double) [ "queue" =. queue ]         maybe_ token $ \token' ->           maybe_ uid $ \uid' ->-            withCurrentWorkDirectory uid' $ \wd ->+            withCurrentWorkDirectory uid' nocopy $ \wd ->               runAmazonStoreCtx uid' $ do                 traceInfo "start" [ "dir" .= wd ]                 t2  <- liftIO getCurrentTime@@ -102,10 +102,10 @@  -- | Run actor from main with config file. ---actMain :: MonadControl m => FilePath -> Text -> String -> m ()-actMain cf queue command =+actMain :: MonadControl m => FilePath -> Text -> Int -> Bool -> String -> m ()+actMain cf queue num nocopy command =   runCtx $     runStatsCtx $ do       conf <- readYaml cf       runConfCtx conf $-        forever $ act queue command+        runConcurrent $ replicate num $ forever $ act queue nocopy command
src/Network/AWS/Wolf/File.hs view
@@ -142,10 +142,11 @@  -- | Setup a temporary work directory and copy current directory files to it. ---withCurrentWorkDirectory :: MonadControl m => Text -> (FilePath -> m a) -> m a-withCurrentWorkDirectory uid action =+withCurrentWorkDirectory :: MonadControl m => Text -> Bool -> (FilePath -> m a) -> m a+withCurrentWorkDirectory uid nocopy action =   withWorkDirectory uid $ \wd ->     withCurrentDirectory' wd $ \cd -> do-      copyDirectoryRecursive cd wd+      unless nocopy $+        copyDirectoryRecursive cd wd       action wd 
wolf.cabal view
@@ -1,5 +1,5 @@ name: wolf-version: 0.3.23+version: 0.3.24 cabal-version: >=1.22 build-type: Simple license: MIT@@ -59,7 +59,7 @@     main-is: actor.hs     build-depends:         base >=4.8.2.0,-        wolf >=0.3.23,+        wolf,         optparse-generic >=1.1.5     default-language: Haskell2010     hs-source-dirs: main@@ -69,7 +69,7 @@     main-is: decider.hs     build-depends:         base >=4.8.2.0,-        wolf >=0.3.23,+        wolf,         optparse-generic >=1.1.5     default-language: Haskell2010     hs-source-dirs: main@@ -79,7 +79,7 @@     main-is: counter.hs     build-depends:         base >=4.8.2.0,-        wolf >=0.3.23,+        wolf,         optparse-generic >=1.1.5     default-language: Haskell2010     hs-source-dirs: main@@ -92,4 +92,3 @@         shakers >=0.0.27     default-language: Haskell2010     ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall-