summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Schedule.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/Logs/Schedule.hs b/Logs/Schedule.hs
index 7fc210c14..35745b9f3 100644
--- a/Logs/Schedule.hs
+++ b/Logs/Schedule.hs
@@ -8,6 +8,9 @@
module Logs.Schedule (
scheduleLog,
scheduleSet,
+ scheduleAdd,
+ scheduleRemove,
+ scheduleChange,
scheduleGet,
scheduleMap,
getLastRunTimes,
@@ -46,6 +49,15 @@ scheduleGet u = do
m <- scheduleMap
return $ maybe S.empty S.fromList (M.lookup u m)
+scheduleRemove :: UUID -> ScheduledActivity -> Annex ()
+scheduleRemove u activity = scheduleChange u $ S.delete activity
+
+scheduleAdd :: UUID -> ScheduledActivity -> Annex ()
+scheduleAdd u activity = scheduleChange u $ S.insert activity
+
+scheduleChange :: UUID -> (S.Set ScheduledActivity -> S.Set ScheduledActivity) -> Annex ()
+scheduleChange u a = scheduleSet u . S.toList . a =<< scheduleGet u
+
getLastRunTimes :: Annex (M.Map ScheduledActivity LocalTime)
getLastRunTimes = do
f <- fromRepo gitAnnexScheduleState