feat(webhooks): add stream status to webhook (#2934)

Expand the payload sent for stream status webhooks. Closes #2881
This commit is contained in:
Gabe Kangas
2023-05-30 11:32:05 -07:00
committed by GitHub
parent b9508ba1c8
commit 209756fed3
5 changed files with 38 additions and 6 deletions
+12 -3
View File
@@ -24,10 +24,19 @@ type Job struct {
wg *sync.WaitGroup
}
var queue chan Job
var (
queue chan Job
getStatus func() models.Status
)
// InitWorkerPool starts n go routines that await webhook jobs.
func InitWorkerPool() {
// SetupWebhooks initializes the webhook worker pool and sets the function to get the current status.
func SetupWebhooks(getStatusFunc func() models.Status) {
getStatus = getStatusFunc
initWorkerPool()
}
// initWorkerPool starts n go routines that await webhook jobs.
func initWorkerPool() {
queue = make(chan Job)
// start workers