summaryrefslogtreecommitdiff
path: root/Types
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-13 17:14:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-13 17:14:56 -0400
commit7e226e373b203dce324b9d3b7fc2a82ca1781183 (patch)
tree50cf3d083441c4a99d4e46f95a66421e1e1d2a4a /Types
parenta0865e6c494ec4bdfb7ab058a5633a8634d48bd4 (diff)
cronner: run jobs triggered by remotes becoming connected (untested)
Diffstat (limited to 'Types')
-rw-r--r--Types/ScheduledActivity.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Types/ScheduledActivity.hs b/Types/ScheduledActivity.hs
index 386f42333..b683409ce 100644
--- a/Types/ScheduledActivity.hs
+++ b/Types/ScheduledActivity.hs
@@ -19,6 +19,12 @@ data ScheduledActivity
| ScheduledRemoteFsck UUID Schedule Duration
deriving (Eq, Read, Show, Ord)
+{- Activities that run on a remote, within a time window, so
+ - should be run when the remote gets connected. -}
+connectActivityUUID :: ScheduledActivity -> Maybe UUID
+connectActivityUUID (ScheduledRemoteFsck u (Schedule _ AnyTime) _) = Just u
+connectActivityUUID _ = Nothing
+
getSchedule :: ScheduledActivity -> Schedule
getSchedule (ScheduledSelfFsck s _) = s
getSchedule (ScheduledRemoteFsck _ s _) = s