diff options
author | 2013-10-29 13:52:19 -0400 | |
---|---|---|
committer | 2013-10-29 13:52:19 -0400 | |
commit | e802db0b6b69198e4699d63d76b5d0fc78864714 (patch) | |
tree | 7ee36202254e7ea170c8e8a0e6083e1a2c2f1a82 | |
parent | 2db78797ee58e53f06bd2d104fb203c45247e7c0 (diff) |
fix stale git locks as part of repo repair
-rw-r--r-- | Assistant/Threads/ProblemChecker.hs | 4 | ||||
-rw-r--r-- | Assistant/Threads/SanityChecker.hs | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Assistant/Threads/ProblemChecker.hs b/Assistant/Threads/ProblemChecker.hs index 1a30a337e..66dcadfff 100644 --- a/Assistant/Threads/ProblemChecker.hs +++ b/Assistant/Threads/ProblemChecker.hs @@ -41,6 +41,7 @@ handleRemoteProblem :: UrlRenderer -> Remote -> Assistant () handleRemoteProblem urlrenderer rmt | Git.repoIsLocal r && not (Git.repoIsLocalUnknown r) = whenM (liftIO $ checkAvailable True rmt) $ do + repairStaleGitLocks r fsckresults <- showFscking urlrenderer (Just $ Remote.name rmt) $ tryNonAsync $ Git.Fsck.findBroken True r whenM (repairWhenNecessary urlrenderer (Remote.uuid rmt) (Just rmt) fsckresults) $ @@ -50,4 +51,5 @@ handleRemoteProblem urlrenderer rmt r = Remote.repo rmt handleLocalRepoProblem :: UrlRenderer -> Assistant () -handleLocalRepoProblem urlrenderer = error "TODO" +handleLocalRepoProblem urlrenderer = do + repairStaleGitLocks =<< liftAnnex gitRepo diff --git a/Assistant/Threads/SanityChecker.hs b/Assistant/Threads/SanityChecker.hs index 916cf52c4..0dd047fc9 100644 --- a/Assistant/Threads/SanityChecker.hs +++ b/Assistant/Threads/SanityChecker.hs @@ -33,7 +33,7 @@ import Data.Time.Clock.POSIX - being nonresponsive.) -} sanityCheckerStartupThread :: Maybe Duration -> NamedThread sanityCheckerStartupThread startupdelay = namedThreadUnchecked "SanityCheckerStartup" $ do - checkStaleGitLocks + repairStaleGitLocks =<< liftAnnex gitRepo liftIO $ maybe noop (threadDelaySeconds . Seconds . fromIntegral . durationSeconds) startupdelay |