1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-26 03:21:33 +03:00

Record error when fail to health check repository

This commit is contained in:
Unknwon 2016-01-28 06:46:25 -05:00
parent b900150b1d
commit e2dde6eb0a

View File

@ -1602,7 +1602,7 @@ func GitFsck() {
repo := bean.(*Repository) repo := bean.(*Repository)
repoPath := repo.RepoPath() repoPath := repo.RepoPath()
if err := git.Fsck(repoPath, setting.Cron.RepoHealthCheck.Timeout, setting.Cron.RepoHealthCheck.Args...); err != nil { if err := git.Fsck(repoPath, setting.Cron.RepoHealthCheck.Timeout, setting.Cron.RepoHealthCheck.Args...); err != nil {
desc := fmt.Sprintf("Fail to health check repository(%s)", repoPath) desc := fmt.Sprintf("Fail to health check repository (%s): %v", repoPath, err)
log.Warn(desc) log.Warn(desc)
if err = CreateRepositoryNotice(desc); err != nil { if err = CreateRepositoryNotice(desc); err != nil {
log.Error(4, "CreateRepositoryNotice: %v", err) log.Error(4, "CreateRepositoryNotice: %v", err)