diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-18 04:48:49 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-18 04:48:49 -0400 |
| commit | 5f6c3ad56490a8c3063f8daa1cd8b0a302b63ddd (patch) | |
| tree | a05856a744c7ce6a6be69db327e5b8afec013257 /Propellor/Property/Scheduled.hs | |
| parent | 4e4fb9ab7ca13f5148c6d4b08f53f518429530a8 (diff) | |
All Property combinators now combine together their Attr settings.
So Attr settings can be made inside a propertyList, for example.
Diffstat (limited to 'Propellor/Property/Scheduled.hs')
| -rw-r--r-- | Propellor/Property/Scheduled.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Propellor/Property/Scheduled.hs b/Propellor/Property/Scheduled.hs index 0e639129..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 |
