From c10c1b32dbf1ed338fc16e3ec95699302d1ff452 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 2 Sep 2025 10:08:45 -0700 Subject: [PATCH] fix test --- options/locale/locale_en-US.ini | 1 + services/repository/cleanup.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 315241a417..1f69c17cfa 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -3072,6 +3072,7 @@ dashboard.sync_branch.started = Branches Sync started dashboard.sync_tag.started = Tags Sync started dashboard.rebuild_issue_indexer = Rebuild issue indexer dashboard.sync_repo_licenses = Sync repo licenses +dashboard.cleanup_repo_lock_files = Clean up repository lock files users.user_manage_panel = User Account Management users.new_account = Create User Account diff --git a/services/repository/cleanup.go b/services/repository/cleanup.go index 26abbee408..46af56052f 100644 --- a/services/repository/cleanup.go +++ b/services/repository/cleanup.go @@ -10,6 +10,8 @@ import ( repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/modules/gitrepo" "code.gitea.io/gitea/modules/log" + + "xorm.io/builder" ) func CleanupRepo(ctx context.Context) error { @@ -17,7 +19,7 @@ func CleanupRepo(ctx context.Context) error { if err := db.Iterate( ctx, - nil, + builder.Eq{"is_empty": false}, func(ctx context.Context, repo *repo_model.Repository) error { select { case <-ctx.Done():