mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 22:17:20 +00:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user