Remove incorrect "db.DefaultContext" usages (#35366)

This commit is contained in:
wxiaoguang authored and GitHub committed 2025-08-28 03:52:43 +00:00
1 parent 7aef7ea2d4
commit 0cbaa0b662
256 files changed
+1951 -2098

No files matched your search

+2 -1
View File
@@ -23,6 +23,7 @@ import (
"code.gitea.io/gitea/models/webhook"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/gitrepo"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/options"
repo_module "code.gitea.io/gitea/modules/repository"
@@ -459,7 +460,7 @@ func createRepositoryInDB(ctx context.Context, doer, u *user_model.User, repo *r
}
func cleanupRepository(repoID int64) {
if errDelete := DeleteRepositoryDirectly(db.DefaultContext, repoID); errDelete != nil {
if errDelete := DeleteRepositoryDirectly(graceful.GetManager().ShutdownContext(), repoID); errDelete != nil {
log.Error("cleanupRepository failed: %v", errDelete)
// add system notice
if err := system_model.CreateRepositoryNotice("DeleteRepositoryDirectly failed when cleanup repository: %v", errDelete); err != nil {