Add support for forward-env in BackgroundConfig

This commit is contained in:
Bryan Richter 2015-06-29 11:31:52 -07:00
parent 46f5eaad89
commit 54bf1d3845

View File

@ -409,6 +409,7 @@ data BackgroundConfig = BackgroundConfig
, bgconfigEnvironment :: !(Map Text Text) , bgconfigEnvironment :: !(Map Text Text)
, bgconfigRestartCount :: !RestartCount , bgconfigRestartCount :: !RestartCount
, bgconfigRestartDelaySeconds :: !Word , bgconfigRestartDelaySeconds :: !Word
, bgconfigForwardEnv :: !(Set Text)
} }
deriving Show deriving Show
@ -426,6 +427,7 @@ instance ParseYamlFile BackgroundConfig where
<*> o .:? "env" .!= Map.empty <*> o .:? "env" .!= Map.empty
<*> o .:? "restart-count" .!= UnlimitedRestarts <*> o .:? "restart-count" .!= UnlimitedRestarts
<*> o .:? "restart-delay-seconds" .!= 5 <*> o .:? "restart-delay-seconds" .!= 5
<*> o .:? "forward-env" .!= Set.empty
instance ToJSON BackgroundConfig where instance ToJSON BackgroundConfig where
toJSON BackgroundConfig {..} = object $ catMaybes toJSON BackgroundConfig {..} = object $ catMaybes
@ -436,4 +438,5 @@ instance ToJSON BackgroundConfig where
UnlimitedRestarts -> Nothing UnlimitedRestarts -> Nothing
LimitedRestarts count -> Just $ "restart-count" .= count LimitedRestarts count -> Just $ "restart-count" .= count
, Just $ "restart-delay-seconds" .= bgconfigRestartDelaySeconds , Just $ "restart-delay-seconds" .= bgconfigRestartDelaySeconds
, Just $ "forward-env" .= bgconfigForwardEnv
] ]