1
0
Fork 0
forked from forgejo/forgejo

Add admin dashboard option to run health checks (#3606)

There's one for git gc, why not git fsck too?

Also add a couple more trace logs to GitFsck to see progress
This commit is contained in:
Allen Wild 2018-03-02 04:09:43 -05:00 committed by Lauris BH
parent 2cd3622ddc
commit 8606d9f5bc
4 changed files with 12 additions and 0 deletions

View file

@ -2172,6 +2172,7 @@ func GitFsck() {
func(idx int, bean interface{}) error {
repo := bean.(*Repository)
repoPath := repo.RepoPath()
log.Trace(fmt.Sprintf("Running health check for repository %s", repoPath))
if err := git.Fsck(repoPath, setting.Cron.RepoHealthCheck.Timeout, setting.Cron.RepoHealthCheck.Args...); err != nil {
desc := fmt.Sprintf("Failed to health check repository (%s): %v", repoPath, err)
log.Warn(desc)
@ -2183,6 +2184,7 @@ func GitFsck() {
}); err != nil {
log.Error(4, "GitFsck: %v", err)
}
log.Trace("Finished: GitFsck")
}
// GitGcRepos calls 'git gc' to remove unnecessary files and optimize the local repository