aboutsummaryrefslogtreecommitdiffstats
path: root/src/Reaktor/Plugins/System/Internal.hs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2019-01-26 16:04:29 +0100
committertv <tv@krebsco.de>2019-01-26 16:04:29 +0100
commit3e8aabc3993e4ad1d34c25c1caeb75ff6faa97ff (patch)
treef6cb1332f225e50a03acbed1a9cefb7041266dfb /src/Reaktor/Plugins/System/Internal.hs
parentf8c5b4cfe57cb50503b8333d5d06bd0f99fdecc6 (diff)
Reaktor.Plugins.System: add optional timeout
Diffstat (limited to 'src/Reaktor/Plugins/System/Internal.hs')
-rw-r--r--src/Reaktor/Plugins/System/Internal.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Reaktor/Plugins/System/Internal.hs b/src/Reaktor/Plugins/System/Internal.hs
index 9b1b8de..45b7329 100644
--- a/src/Reaktor/Plugins/System/Internal.hs
+++ b/src/Reaktor/Plugins/System/Internal.hs
@@ -51,6 +51,7 @@ data Hook = Hook
, hArguments :: [CaptureOr Text]
, hWorkDir :: Maybe FilePath
, hCommands :: HashMap Text Command
+ , hTimeout :: Maybe Int
}
deriving Show
@@ -64,6 +65,7 @@ instance FromJSON Hook where
<*> v .:? "arguments" .!= []
<*> v .:? "workdir"
<*> v .:? "commands" .!= mempty
+ <*> (fmap (*1000000) <$> v .:? "timeoutSec" .!= Just 10)
_ -> undefined