diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-02 10:35:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-02 10:35:12 +0800 |
commit | f518fe66620bcb60a5251befca116f8caa48ee42 (patch) | |
tree | 0522717b649d6d5148e11e122048cf8629aafcfb /services | |
parent | 4b8d9e58c58b8952e86e7e5f90a0a8e0480e1de1 (diff) | |
download | gitea-f518fe66620bcb60a5251befca116f8caa48ee42.tar.gz gitea-f518fe66620bcb60a5251befca116f8caa48ee42.zip |
Rename HookQueue to hookQueue (#8778)
* Rename HookQueue to hookQueue
* fix lint
Diffstat (limited to 'services')
-rw-r--r-- | services/milestone/milestone.go | 2 | ||||
-rw-r--r-- | services/mirror/sync.go | 4 | ||||
-rw-r--r-- | services/pull/merge.go | 2 | ||||
-rw-r--r-- | services/pull/pull.go | 3 | ||||
-rw-r--r-- | services/pull/review.go | 9 | ||||
-rw-r--r-- | services/release/release.go | 6 |
6 files changed, 2 insertions, 24 deletions
diff --git a/services/milestone/milestone.go b/services/milestone/milestone.go index d6d18ad985..84e7fb30e2 100644 --- a/services/milestone/milestone.go +++ b/services/milestone/milestone.go @@ -53,8 +53,6 @@ func ChangeMilestoneAssign(issue *models.Issue, doer *models.User, oldMilestoneI } if err != nil { log.Error("PrepareWebhooks [is_pull: %v]: %v", issue.IsPull, err) - } else { - go webhook.HookQueue.Add(issue.RepoID) } return nil } diff --git a/services/mirror/sync.go b/services/mirror/sync.go index 1bf36f5760..a9ce189c03 100644 --- a/services/mirror/sync.go +++ b/services/mirror/sync.go @@ -28,10 +28,6 @@ func syncAction(opType models.ActionType, repo *models.Repository, refName strin return fmt.Errorf("notifyWatchers: %v", err) } - defer func() { - go webhook.HookQueue.Add(repo.ID) - }() - return nil } diff --git a/services/pull/merge.go b/services/pull/merge.go index f13638c292..4a2f4511c4 100644 --- a/services/pull/merge.go +++ b/services/pull/merge.go @@ -369,8 +369,6 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor Sender: doer.APIFormat(), }); err != nil { log.Error("PrepareWebhooks: %v", err) - } else { - go webhook.HookQueue.Add(pr.Issue.Repo.ID) } return nil diff --git a/services/pull/pull.go b/services/pull/pull.go index 65b78f4101..0a4c4a7eee 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -50,8 +50,6 @@ func NewPullRequest(repo *models.Repository, pull *models.Issue, labelIDs []int6 Sender: pull.Poster.APIFormat(), }); err != nil { log.Error("PrepareWebhooks: %v", err) - } else { - go webhook.HookQueue.Add(repo.ID) } return nil @@ -125,7 +123,6 @@ func AddTestPullRequestTask(doer *models.User, repoID int64, branch string, isSy log.Error("PrepareWebhooks [pull_id: %v]: %v", pr.ID, err) continue } - go webhook.HookQueue.Add(pr.Issue.Repo.ID) } } diff --git a/services/pull/review.go b/services/pull/review.go index cffe5da4dd..ffb7be82b2 100644 --- a/services/pull/review.go +++ b/services/pull/review.go @@ -56,7 +56,7 @@ func reviewHook(review *models.Review) error { if err != nil { return err } - if err := webhook.PrepareWebhooks(review.Issue.Repo, reviewHookType, &api.PullRequestPayload{ + return webhook.PrepareWebhooks(review.Issue.Repo, reviewHookType, &api.PullRequestPayload{ Action: api.HookIssueSynchronized, Index: review.Issue.Index, PullRequest: pr.APIFormat(), @@ -66,10 +66,5 @@ func reviewHook(review *models.Review) error { Type: string(reviewHookType), Content: review.Content, }, - }); err != nil { - return err - } - go webhook.HookQueue.Add(review.Issue.Repo.ID) - - return nil + }) } diff --git a/services/release/release.go b/services/release/release.go index 42db1f3417..a3f027c949 100644 --- a/services/release/release.go +++ b/services/release/release.go @@ -92,8 +92,6 @@ func CreateRelease(gitRepo *git.Repository, rel *models.Release, attachmentUUIDs Sender: rel.Publisher.APIFormat(), }); err != nil { log.Error("PrepareWebhooks: %v", err) - } else { - go webhook.HookQueue.Add(rel.Repo.ID) } } } @@ -129,8 +127,6 @@ func UpdateRelease(doer *models.User, gitRepo *git.Repository, rel *models.Relea Sender: doer.APIFormat(), }); err1 != nil { log.Error("PrepareWebhooks: %v", err) - } else { - go webhook.HookQueue.Add(rel.Repo.ID) } return err @@ -195,8 +191,6 @@ func DeleteReleaseByID(id int64, doer *models.User, delTag bool) error { Sender: doer.APIFormat(), }); err != nil { log.Error("PrepareWebhooks: %v", err) - } else { - go webhook.HookQueue.Add(rel.Repo.ID) } return nil |