summaryrefslogtreecommitdiff
path: root/Propellor/Property/Scheduled.hs
diff options
context:
space:
mode:
authorJoey Hess2014-04-10 17:22:32 -0400
committerJoey Hess2014-04-10 17:23:43 -0400
commit25942fb0cca0ca90933026bf959506e099ff95a4 (patch)
tree2f84378c71abaa4458c5078e8cb8e6726bffbefd /Propellor/Property/Scheduled.hs
parent5acaf8758f752574140dd79de7996d91a81d1cd4 (diff)
Propellor monad is a Reader for HostAttr
So far, the hostname is only used to improve a message in withPrivData, but I anticipate using HostAttr for a lot more.
Diffstat (limited to 'Propellor/Property/Scheduled.hs')
-rw-r--r--Propellor/Property/Scheduled.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Propellor/Property/Scheduled.hs b/Propellor/Property/Scheduled.hs
index 827c648c..8341765e 100644
--- a/Propellor/Property/Scheduled.hs
+++ b/Propellor/Property/Scheduled.hs
@@ -20,13 +20,13 @@ import qualified Data.Map as M
-- last run.
period :: Property -> Recurrance -> Property
period prop recurrance = Property desc $ do
- lasttime <- getLastChecked (propertyDesc prop)
- nexttime <- fmap startTime <$> nextTime schedule lasttime
- t <- localNow
+ lasttime <- liftIO $ getLastChecked (propertyDesc prop)
+ nexttime <- liftIO $ fmap startTime <$> nextTime schedule lasttime
+ t <- liftIO localNow
if Just t >= nexttime
then do
r <- ensureProperty prop
- setLastChecked t (propertyDesc prop)
+ liftIO $ setLastChecked t (propertyDesc prop)
return r
else noChange
where
@@ -38,7 +38,7 @@ periodParse :: Property -> String -> Property
periodParse prop s = case toRecurrance s of
Just recurrance -> period prop recurrance
Nothing -> Property "periodParse" $ do
- warningMessage $ "failed periodParse: " ++ s
+ liftIO $ warningMessage $ "failed periodParse: " ++ s
noChange
lastCheckedFile :: FilePath