summaryrefslogtreecommitdiff
path: root/Assistant/Monad.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-27 16:42:13 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-27 16:42:13 -0400
commitbe581a2722e78f8a2e59e5ca78a1090efc432307 (patch)
treea24cb16a152bcce74bf4ae279056ac1f17ab4695 /Assistant/Monad.hs
parent4b0b07f1783705714dd75ca1812ab676260e5728 (diff)
automatically launch git repository repair
Added a RemoteChecker thread, that waits for problems to be reported with remotes, and checks if their git repository is in need of repair. Currently, only failures to sync with the remote cause a problem to be reported. This seems enough, but we'll see. Plugging in a removable drive with a repository on it that is corrupted does automatically repair the repository, as long as the corruption causes git push or git pull to fail. Some types of corruption do not, eg missing/corrupt objects for blobs that git push doesn't need to look at. So, this is not really a replacement for scheduled git repository fscking. But it does make the assistant more robust. This commit is sponsored by Fernando Jimenez.
Diffstat (limited to 'Assistant/Monad.hs')
-rw-r--r--Assistant/Monad.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Assistant/Monad.hs b/Assistant/Monad.hs
index 4b73061f9..154813785 100644
--- a/Assistant/Monad.hs
+++ b/Assistant/Monad.hs
@@ -39,6 +39,7 @@ import Assistant.Types.Pushes
import Assistant.Types.BranchChange
import Assistant.Types.Commits
import Assistant.Types.Changes
+import Assistant.Types.RemoteProblem
import Assistant.Types.Buddies
import Assistant.Types.NetMessager
import Assistant.Types.ThreadName
@@ -63,6 +64,7 @@ data AssistantData = AssistantData
, failedPushMap :: FailedPushMap
, commitChan :: CommitChan
, changePool :: ChangePool
+ , remoteProblemChan :: RemoteProblemChan
, branchChangeHandle :: BranchChangeHandle
, buddyList :: BuddyList
, netMessager :: NetMessager
@@ -80,6 +82,7 @@ newAssistantData st dstatus = AssistantData
<*> newFailedPushMap
<*> newCommitChan
<*> newChangePool
+ <*> newRemoteProblemChan
<*> newBranchChangeHandle
<*> newBuddyList
<*> newNetMessager