mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 16:24:06 +01:00
small cache when get user id on interation (#29296)
This commit is contained in:
parent
d6811baf88
commit
182b9c1936
1 changed files with 5 additions and 5 deletions
|
@ -38,6 +38,11 @@ func ProcReceive(ctx context.Context, repo *repo_model.Repository, gitRepo *git.
|
||||||
_, forcePush = opts.GitPushOptions["force-push"]
|
_, forcePush = opts.GitPushOptions["force-push"]
|
||||||
objectFormat, _ := gitRepo.GetObjectFormat()
|
objectFormat, _ := gitRepo.GetObjectFormat()
|
||||||
|
|
||||||
|
pusher, err := user_model.GetUserByID(ctx, opts.UserID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("Failed to get user. Error: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
for i := range opts.OldCommitIDs {
|
for i := range opts.OldCommitIDs {
|
||||||
if opts.NewCommitIDs[i] == objectFormat.EmptyObjectID().String() {
|
if opts.NewCommitIDs[i] == objectFormat.EmptyObjectID().String() {
|
||||||
results = append(results, private.HookProcReceiveRefResult{
|
results = append(results, private.HookProcReceiveRefResult{
|
||||||
|
@ -116,11 +121,6 @@ func ProcReceive(ctx context.Context, repo *repo_model.Repository, gitRepo *git.
|
||||||
description = opts.GitPushOptions["description"]
|
description = opts.GitPushOptions["description"]
|
||||||
}
|
}
|
||||||
|
|
||||||
pusher, err := user_model.GetUserByID(ctx, opts.UserID)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("Failed to get user. Error: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
prIssue := &issues_model.Issue{
|
prIssue := &issues_model.Issue{
|
||||||
RepoID: repo.ID,
|
RepoID: repo.ID,
|
||||||
Title: title,
|
Title: title,
|
||||||
|
|
Loading…
Reference in a new issue