1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-24 18:23:11 +00:00

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

This commit is contained in:
silentcodeg 2022-05-19 15:46:56 +02:00 committed by GitHub
parent ad551bffc1
commit c27268db21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}