summaryrefslogtreecommitdiff
path: root/Assistant/Types
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-29 14:22:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-29 14:25:20 -0400
commit16d6ab71124876f7cffb79778cf8de1b23b5c1ba (patch)
tree088d256697b521d069c14f3e05c70540586de7ad /Assistant/Types
parente802db0b6b69198e4699d63d76b5d0fc78864714 (diff)
add post-repair actions
Diffstat (limited to 'Assistant/Types')
-rw-r--r--Assistant/Types/RepoProblem.hs14
1 files changed, 12 insertions, 2 deletions
diff --git a/Assistant/Types/RepoProblem.hs b/Assistant/Types/RepoProblem.hs
index 40397c708..ece5a5286 100644
--- a/Assistant/Types/RepoProblem.hs
+++ b/Assistant/Types/RepoProblem.hs
@@ -1,4 +1,4 @@
-{- git-annex assistant remote problem detection
+{- git-annex assistant repository problem tracking
-
- Copyright 2013 Joey Hess <joey@kitenet.net>
-
@@ -11,8 +11,18 @@ import Types
import Utility.TList
import Control.Concurrent.STM
+import Data.Function
-type RepoProblemChan = TList UUID
+data RepoProblem = RepoProblem
+ { problemUUID :: UUID
+ , afterFix :: IO ()
+ }
+
+{- The afterFix actions are assumed to all be equivilant. -}
+sameRepoProblem :: RepoProblem -> RepoProblem -> Bool
+sameRepoProblem = (==) `on` problemUUID
+
+type RepoProblemChan = TList RepoProblem
newRepoProblemChan :: IO RepoProblemChan
newRepoProblemChan = atomically newTList