From 9c6f2a132dcafa8d6c1ace6a0c01b2e8569c65c7 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 23 Oct 2024 09:28:28 +0800 Subject: [PATCH] Add warn log when deleting inactive users (#32318) Add log for the problem #31480 (cherry picked from commit a264c46fb04112c5ec2c1b2acd523a2e4450da40) Conflicts: - services/user/user.go Resolved by manually adding the log line. --- services/user/user.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/user/user.go b/services/user/user.go index 4e983eb9f6..653f5a9cd2 100644 --- a/services/user/user.go +++ b/services/user/user.go @@ -306,6 +306,7 @@ func DeleteInactiveUsers(ctx context.Context, olderThan time.Duration) error { // Ignore users that were set inactive by admin. if models.IsErrUserOwnRepos(err) || models.IsErrUserHasOrgs(err) || models.IsErrUserOwnPackages(err) || models.IsErrDeleteLastAdminUser(err) { + log.Warn("Inactive user %q has repositories, organizations or packages, skipping deletion: %v", u.Name, err) continue } return err