diff --git a/models/user.go b/models/user.go index c5766cb91c79f..68be0d855509b 100644 --- a/models/user.go +++ b/models/user.go @@ -103,7 +103,7 @@ func DeleteUser(ctx context.Context, u *user_model.User, purge bool) (err error) // Delete Comments const batchSize = 50 for { - comments := make([]*issues_model.Comment, 0, 50) + comments := make([]*issues_model.Comment, 0, batchSize) if err = e.Where("type=? AND poster_id=?", issues_model.CommentTypeComment, u.ID).Limit(batchSize, 0).Find(&comments); err != nil { return err }