summaryrefslogtreecommitdiffstats
path: root/modules/doctor
diff options
context:
space:
mode:
authorsilentcodeg <105681448+silentcodeg@users.noreply.github.com>2022-05-19 15:46:56 +0200
committerGitHub <noreply@github.com>2022-05-19 15:46:56 +0200
commitc27268db21427fcf6f8d90cce8713febdb6f4719 (patch)
tree8dd1f2a3576c52e2834f2c314c52c0f85bb5866e /modules/doctor
parentad551bffc1768245db075aa3d1b998b6f5997ae4 (diff)
downloadgitea-c27268db21427fcf6f8d90cce8713febdb6f4719.tar.gz
gitea-c27268db21427fcf6f8d90cce8713febdb6f4719.zip
[doctor] do not update User Stars numbers unless --fix (#19750)
Diffstat (limited to 'modules/doctor')
-rw-r--r--modules/doctor/misc.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/doctor/misc.go b/modules/doctor/misc.go
index 8489a5ef41..9bee78303e 100644
--- a/modules/doctor/misc.go
+++ b/modules/doctor/misc.go
@@ -75,9 +75,14 @@ func checkHooks(ctx context.Context, logger log.Logger, autofix bool) error {
}
func checkUserStarNum(ctx context.Context, logger log.Logger, autofix bool) error {
- if err := models.DoctorUserStarNum(); err != nil {
- logger.Critical("Unable update User Stars numbers")
- return err
+ if autofix {
+ if err := models.DoctorUserStarNum(); err != nil {
+ logger.Critical("Unable update User Stars numbers")
+ return err
+ }
+ logger.Info("Updated User Stars numbers.")
+ } else {
+ logger.Info("No check available for User Stars numbers (skipped)")
}
return nil
}