summaryrefslogtreecommitdiff
path: root/Propellor/Property/Scheduled.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-04-19 02:10:56 -0400
committerJoey Hess <joey@kitenet.net>2014-04-19 02:10:56 -0400
commit5dd316a0ad4abce5e81ea19e52caf7b57081cda3 (patch)
tree92070fc17e1a57245e1d0f89d5d3bf8599406d85 /Propellor/Property/Scheduled.hs
parent5b4f3d109ee7393b1e44cac60b43def2ce4c8b24 (diff)
parent6aeeaaab9073675e8c043d009c97ff62d809975b (diff)
Merge branch 'joeyconfig'
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