aboutsummaryrefslogtreecommitdiffstats
path: root/services/agit
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-07-22 22:14:27 +0800
committerGitHub <noreply@github.com>2023-07-22 22:14:27 +0800
commitb167f35113e643ccdb17a2dde55bdec5960b284b (patch)
tree99a6e53bf1a9d4c9199c19113650cc48a8c1fd0e /services/agit
parentc42b71877edb4830b9573101d20853222d66fb3c (diff)
downloadgitea-b167f35113e643ccdb17a2dde55bdec5960b284b.tar.gz
gitea-b167f35113e643ccdb17a2dde55bdec5960b284b.zip
Add context parameter to some database functions (#26055)
To avoid deadlock problem, almost database related functions should be have ctx as the first parameter. This PR do a refactor for some of these functions.
Diffstat (limited to 'services/agit')
-rw-r--r--services/agit/agit.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/agit/agit.go b/services/agit/agit.go
index 208ea109f4..ac8c52d19c 100644
--- a/services/agit/agit.go
+++ b/services/agit/agit.go
@@ -197,7 +197,7 @@ func ProcReceive(ctx context.Context, repo *repo_model.Repository, gitRepo *git.
return nil, fmt.Errorf("Failed to update pull ref. Error: %w", err)
}
- pull_service.AddToTaskQueue(pr)
+ pull_service.AddToTaskQueue(ctx, pr)
pusher, err := user_model.GetUserByID(ctx, opts.UserID)
if err != nil {
return nil, fmt.Errorf("Failed to get user. Error: %w", err)