diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-07-22 22:14:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-22 22:14:27 +0800 |
commit | b167f35113e643ccdb17a2dde55bdec5960b284b (patch) | |
tree | 99a6e53bf1a9d4c9199c19113650cc48a8c1fd0e /services/agit | |
parent | c42b71877edb4830b9573101d20853222d66fb3c (diff) | |
download | gitea-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.go | 2 |
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) |