[doctor] do not update User Stars numbers unless --fix (#19750)

tokarchuk/v1.17
silentcodeg 3 years ago committed by GitHub
parent ad551bffc1
commit c27268db21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      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 { func checkUserStarNum(ctx context.Context, logger log.Logger, autofix bool) error {
if err := models.DoctorUserStarNum(); err != nil { if autofix {
logger.Critical("Unable update User Stars numbers") if err := models.DoctorUserStarNum(); err != nil {
return err 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 return nil
} }

Loading…
Cancel
Save