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/mirror | |
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/mirror')
-rw-r--r-- | services/mirror/sync.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/mirror/sync.go b/services/mirror/sync.go index 4bc153b47f..1bf36f5760 100644 --- a/services/mirror/sync.go +++ b/services/mirror/sync.go @@ -11,6 +11,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/setting" api "code.gitea.io/gitea/modules/structs" + "code.gitea.io/gitea/modules/webhook" ) func syncAction(opType models.ActionType, repo *models.Repository, refName string, data []byte) error { @@ -28,7 +29,7 @@ func syncAction(opType models.ActionType, repo *models.Repository, refName strin } defer func() { - go models.HookQueue.Add(repo.ID) + go webhook.HookQueue.Add(repo.ID) }() return nil @@ -55,7 +56,7 @@ func SyncPushAction(repo *models.Repository, opts SyncPushActionOptions) error { opts.Commits.CompareURL = repo.ComposeCompareURL(opts.OldCommitID, opts.NewCommitID) apiPusher := repo.MustOwner().APIFormat() - if err := models.PrepareWebhooks(repo, models.HookEventPush, &api.PushPayload{ + if err := webhook.PrepareWebhooks(repo, models.HookEventPush, &api.PushPayload{ Ref: opts.RefName, Before: opts.OldCommitID, After: opts.NewCommitID, |