diff options
Diffstat (limited to 'cmd/doctor.go')
-rw-r--r-- | cmd/doctor.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cmd/doctor.go b/cmd/doctor.go index 3456f26f70..45a50c8266 100644 --- a/cmd/doctor.go +++ b/cmd/doctor.go @@ -574,6 +574,22 @@ func runDoctorCheckDBConsistency(ctx *cli.Context) ([]string, error) { } } + count, err = models.CountNullArchivedRepository() + if err != nil { + return nil, err + } + if count > 0 { + if ctx.Bool("fix") { + updatedCount, err := models.FixNullArchivedRepository() + if err != nil { + return nil, err + } + results = append(results, fmt.Sprintf("%d repositories with null is_archived updated", updatedCount)) + } else { + results = append(results, fmt.Sprintf("%d repositories with null is_archived", count)) + } + } + //ToDo: function to recalc all counters return results, nil |