Add replay of webhooks. (#18191)

This commit is contained in:
KN4CK3R 2022-01-05 22:00:20 +01:00 committed by GitHub
parent a38ba634a4
commit bf7b083cfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 108 additions and 13 deletions

View file

@ -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
}