summaryrefslogtreecommitdiff
path: root/Propellor/Property/Scheduled.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Propellor/Property/Scheduled.hs')
-rw-r--r--Propellor/Property/Scheduled.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Propellor/Property/Scheduled.hs b/Propellor/Property/Scheduled.hs
index 769a3931..f2911e50 100644
--- a/Propellor/Property/Scheduled.hs
+++ b/Propellor/Property/Scheduled.hs
@@ -19,13 +19,13 @@ import qualified Data.Map as M
-- This uses the description of the Property to keep track of when it was
-- last run.
period :: Property -> Recurrance -> Property
-period prop recurrance = Property desc $ do
+period prop recurrance = flip describe desc $ adjustProperty prop $ \satisfy -> do
lasttime <- liftIO $ getLastChecked (propertyDesc prop)
nexttime <- liftIO $ fmap startTime <$> nextTime schedule lasttime
t <- liftIO localNow
if Just t >= nexttime
then do
- r <- ensureProperty prop
+ r <- satisfy
liftIO $ setLastChecked t (propertyDesc prop)
return r
else noChange
@@ -37,7 +37,7 @@ period prop recurrance = Property desc $ do
periodParse :: Property -> String -> Property
periodParse prop s = case toRecurrance s of
Just recurrance -> period prop recurrance
- Nothing -> Property "periodParse" $ do
+ Nothing -> property "periodParse" $ do
liftIO $ warningMessage $ "failed periodParse: " ++ s
noChange