wolf 0.3.27 → 0.3.28
raw patch · 3 files changed
+15/−4 lines, 3 files
Files
- main/actor.hs +3/−0
- src/Network/AWS/Wolf/Act.hs +11/−3
- wolf.cabal +1/−1
main/actor.hs view
@@ -14,6 +14,8 @@ data Args = Args { config :: FilePath -- ^ Configuration file.+ , quiesce :: Maybe FilePath+ -- ^ Optional quiesce file to stop actor. , queue :: Text -- ^ Queue to listen to act on. , num :: Maybe Int@@ -35,6 +37,7 @@ args <- getRecord "Actor" actMain (config args)+ (quiesce args) (queue args) (fromMaybe 1 $ num args) (nocopy args)
src/Network/AWS/Wolf/Act.hs view
@@ -16,6 +16,7 @@ import Network.AWS.Wolf.Prelude import Network.AWS.Wolf.SWF import Network.AWS.Wolf.Types+import System.Directory import System.Process -- | S3 copy call.@@ -63,6 +64,11 @@ traceInfo "end" [ "exception" .= (displayException <$> e) ] pure e +-- | Check if quiesce file is present.+--+check :: MonadIO m => Maybe FilePath -> m Bool+check = maybe (pure False) (liftIO . doesFileExist)+ -- | Actor logic - poll for work, download artifacts, run command, upload artifacts. -- act :: MonadConf c m => Text -> Bool -> Bool -> String -> m ()@@ -102,10 +108,12 @@ -- | Run actor from main with config file. ---actMain :: MonadControl m => FilePath -> Text -> Int -> Bool -> Bool -> String -> m ()-actMain cf queue num nocopy local command =+actMain :: MonadControl m => FilePath -> Maybe FilePath -> Text -> Int -> Bool -> Bool -> String -> m ()+actMain cf quiesce queue num nocopy local command = runCtx $ runStatsCtx $ do conf <- readYaml cf runConfCtx conf $- runConcurrent $ replicate num $ forever $ act queue nocopy local command+ runConcurrent $ replicate num $ forever $ do+ boolThrowIO "Quiesce" =<< not <$> check quiesce+ act queue nocopy local command
wolf.cabal view
@@ -1,5 +1,5 @@ name: wolf-version: 0.3.27+version: 0.3.28 synopsis: Amazon Simple Workflow Service Wrapper. description: Wolf is a wrapper around Amazon Simple Workflow Service. homepage: https://github.com/swift-nav/wolf