File tree Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2172,6 +2172,7 @@ func GitFsck() {
21722172 func (idx int , bean interface {}) error {
21732173 repo := bean .(* Repository )
21742174 repoPath := repo .RepoPath ()
2175+ log .Trace (fmt .Sprintf ("Running health check for repository %s" , repoPath ))
21752176 if err := git .Fsck (repoPath , setting .Cron .RepoHealthCheck .Timeout , setting .Cron .RepoHealthCheck .Args ... ); err != nil {
21762177 desc := fmt .Sprintf ("Failed to health check repository (%s): %v" , repoPath , err )
21772178 log .Warn (desc )
@@ -2183,6 +2184,7 @@ func GitFsck() {
21832184 }); err != nil {
21842185 log .Error (4 , "GitFsck: %v" , err )
21852186 }
2187+ log .Trace ("Finished: GitFsck" )
21862188}
21872189
21882190// GitGcRepos calls 'git gc' to remove unnecessary files and optimize the local repository
Original file line number Diff line number Diff line change @@ -1220,6 +1220,8 @@ dashboard.reinit_missing_repos = Reinitialize all missing Git repositories for w
12201220dashboard.reinit_missing_repos_success = All missing Git repositories for which records existed have been reinitialized.
12211221dashboard.sync_external_users = Synchronize external user data
12221222dashboard.sync_external_users_started = External user synchronization started
1223+ dashboard.git_fsck = Execute health checks on all repositories
1224+ dashboard.git_fsck_started = Repository health checks started
12231225dashboard.server_uptime = Server Uptime
12241226dashboard.current_goroutine = Current Goroutines
12251227dashboard.current_memory_usage = Current Memory Usage
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ const (
122122 syncRepositoryUpdateHook
123123 reinitMissingRepository
124124 syncExternalUsers
125+ gitFsck
125126)
126127
127128// Dashboard show admin panel dashboard
@@ -161,6 +162,9 @@ func Dashboard(ctx *context.Context) {
161162 case syncExternalUsers :
162163 success = ctx .Tr ("admin.dashboard.sync_external_users_started" )
163164 go models .SyncExternalUsers ()
165+ case gitFsck :
166+ success = ctx .Tr ("admin.dashboard.git_fsck_started" )
167+ go models .GitFsck ()
164168 }
165169
166170 if err != nil {
Original file line number Diff line number Diff line change 4949 <td>{{.i18n.Tr "admin.dashboard.sync_external_users"}}</td>
5050 <td><i class="fa fa-caret-square-o-right"></i> <a href="{{AppSubUrl}}/admin?op=8">{{.i18n.Tr "admin.dashboard.operation_run"}}</a></td>
5151 </tr>
52+ <tr>
53+ <td>{{.i18n.Tr "admin.dashboard.git_fsck"}}</td>
54+ <td><i class="fa fa-caret-square-o-right"></i> <a href="{{AppSubUrl}}/admin?op=9">{{.i18n.Tr "admin.dashboard.operation_run"}}</a></td>
55+ </tr>
5256 </tbody>
5357 </table>
5458 </div>
You can’t perform that action at this time.
0 commit comments