diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-02 06:51:22 +0800 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-11-01 22:51:22 +0000 |
commit | 0e7f7df3cf176640c66ddf286ec052c7c13beb8a (patch) | |
tree | 16afa02dd0b3df428aa7d9daadd4796eef907332 /services/pull/merge.go | |
parent | ba336f6f456835f1f327ee967991079dd220266d (diff) | |
download | gitea-0e7f7df3cf176640c66ddf286ec052c7c13beb8a.tar.gz gitea-0e7f7df3cf176640c66ddf286ec052c7c13beb8a.zip |
Move webhook to a standalone package under modules (#8747)
* Move webhook to a standalone package under modules
* fix test
* fix comments
Diffstat (limited to 'services/pull/merge.go')
-rw-r--r-- | services/pull/merge.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/pull/merge.go b/services/pull/merge.go index 2e093eef86..f13638c292 100644 --- a/services/pull/merge.go +++ b/services/pull/merge.go @@ -23,6 +23,7 @@ import ( "code.gitea.io/gitea/modules/setting" api "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/timeutil" + "code.gitea.io/gitea/modules/webhook" "github.com/mcuadros/go-version" ) @@ -360,7 +361,7 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor } mode, _ := models.AccessLevel(doer, pr.Issue.Repo) - if err = models.PrepareWebhooks(pr.Issue.Repo, models.HookEventPullRequest, &api.PullRequestPayload{ + if err = webhook.PrepareWebhooks(pr.Issue.Repo, models.HookEventPullRequest, &api.PullRequestPayload{ Action: api.HookIssueClosed, Index: pr.Index, PullRequest: pr.APIFormat(), @@ -369,7 +370,7 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor }); err != nil { log.Error("PrepareWebhooks: %v", err) } else { - go models.HookQueue.Add(pr.Issue.Repo.ID) + go webhook.HookQueue.Add(pr.Issue.Repo.ID) } return nil |