From 3e8aabc3993e4ad1d34c25c1caeb75ff6faa97ff Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 26 Jan 2019 16:04:29 +0100 Subject: Reaktor.Plugins.System: add optional timeout --- src/Reaktor/Plugins/System/Internal.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Reaktor/Plugins/System/Internal.hs') 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 -- cgit v1.2.3