Add warn log when deleting inactive users (#32318)

Add log for the problem #31480
pull/32263/head^2
Lunny Xiao 4 weeks ago committed by GitHub
parent 9206fbb55f
commit a264c46fb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      services/user/user.go

@ -289,6 +289,7 @@ func DeleteInactiveUsers(ctx context.Context, olderThan time.Duration) error {
if err = DeleteUser(ctx, u, false); err != nil { if err = DeleteUser(ctx, u, false); err != nil {
// Ignore inactive users that were ever active but then were set inactive by admin // Ignore inactive users that were ever active but then were set inactive by admin
if models.IsErrUserOwnRepos(err) || models.IsErrUserHasOrgs(err) || models.IsErrUserOwnPackages(err) { if models.IsErrUserOwnRepos(err) || models.IsErrUserHasOrgs(err) || models.IsErrUserOwnPackages(err) {
log.Warn("Inactive user %q has repositories, organizations or packages, skipping deletion: %v", u.Name, err)
continue continue
} }
select { select {

Loading…
Cancel
Save