File tree 4 files changed +12
-0
lines changed
4 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2172,6 +2172,7 @@ func GitFsck() {
2172
2172
func (idx int , bean interface {}) error {
2173
2173
repo := bean .(* Repository )
2174
2174
repoPath := repo .RepoPath ()
2175
+ log .Trace (fmt .Sprintf ("Running health check for repository %s" , repoPath ))
2175
2176
if err := git .Fsck (repoPath , setting .Cron .RepoHealthCheck .Timeout , setting .Cron .RepoHealthCheck .Args ... ); err != nil {
2176
2177
desc := fmt .Sprintf ("Failed to health check repository (%s): %v" , repoPath , err )
2177
2178
log .Warn (desc )
@@ -2183,6 +2184,7 @@ func GitFsck() {
2183
2184
}); err != nil {
2184
2185
log .Error (4 , "GitFsck: %v" , err )
2185
2186
}
2187
+ log .Trace ("Finished: GitFsck" )
2186
2188
}
2187
2189
2188
2190
// 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
1220
1220
dashboard.reinit_missing_repos_success = All missing Git repositories for which records existed have been reinitialized.
1221
1221
dashboard.sync_external_users = Synchronize external user data
1222
1222
dashboard.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
1223
1225
dashboard.server_uptime = Server Uptime
1224
1226
dashboard.current_goroutine = Current Goroutines
1225
1227
dashboard.current_memory_usage = Current Memory Usage
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ const (
122
122
syncRepositoryUpdateHook
123
123
reinitMissingRepository
124
124
syncExternalUsers
125
+ gitFsck
125
126
)
126
127
127
128
// Dashboard show admin panel dashboard
@@ -161,6 +162,9 @@ func Dashboard(ctx *context.Context) {
161
162
case syncExternalUsers :
162
163
success = ctx .Tr ("admin.dashboard.sync_external_users_started" )
163
164
go models .SyncExternalUsers ()
165
+ case gitFsck :
166
+ success = ctx .Tr ("admin.dashboard.git_fsck_started" )
167
+ go models .GitFsck ()
164
168
}
165
169
166
170
if err != nil {
Original file line number Diff line number Diff line change 49
49
<td>{{.i18n.Tr "admin.dashboard.sync_external_users"}}</td>
50
50
<td><i class="fa fa-caret-square-o-right"></i> <a href="{{AppSubUrl}}/admin?op=8">{{.i18n.Tr "admin.dashboard.operation_run"}}</a></td>
51
51
</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>
52
56
</tbody>
53
57
</table>
54
58
</div>
You can’t perform that action at this time.
0 commit comments