From c27268db21427fcf6f8d90cce8713febdb6f4719 Mon Sep 17 00:00:00 2001 From: silentcodeg <105681448+silentcodeg@users.noreply.github.com> Date: Thu, 19 May 2022 15:46:56 +0200 Subject: [PATCH] [doctor] do not update User Stars numbers unless --fix (#19750) --- modules/doctor/misc.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/doctor/misc.go b/modules/doctor/misc.go index 8489a5ef4..9bee78303 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 }