summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-01-05 22:00:20 +0100
committerGitHub <noreply@github.com>2022-01-05 15:00:20 -0600
commitbf7b083cfe47cc922090ce7922b89f7a5030a44d (patch)
tree62291bc31a1dd28252a8802555d09085d30416ee /services
parenta38ba634a4da15fbb2d1b6ac6742cf01c1503ea4 (diff)
downloadgitea-bf7b083cfe47cc922090ce7922b89f7a5030a44d.tar.gz
gitea-bf7b083cfe47cc922090ce7922b89f7a5030a44d.zip
Add replay of webhooks. (#18191)
Diffstat (limited to 'services')
-rw-r--r--services/webhook/webhook.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/services/webhook/webhook.go b/services/webhook/webhook.go
index 9356f4ee11..f284a20c30 100644
--- a/services/webhook/webhook.go
+++ b/services/webhook/webhook.go
@@ -229,3 +229,15 @@ func prepareWebhooks(repo *repo_model.Repository, event webhook_model.HookEventT
}
return nil
}
+
+// ReplayHookTask replays a webhook task
+func ReplayHookTask(w *webhook_model.Webhook, uuid string) error {
+ t, err := webhook_model.ReplayHookTask(w.ID, uuid)
+ if err != nil {
+ return err
+ }
+
+ go hookQueue.Add(t.RepoID)
+
+ return nil
+}