1
0

feat(webhooks): add timeout config option

This commit is contained in:
kolaente
2023-10-17 19:06:25 +02:00
parent 34a92b759e
commit b38360c9a5
2 changed files with 5 additions and 1 deletions

View File

@ -162,7 +162,10 @@ func (w *Webhook) sendWebhookPayload(p *WebhookPayload) (err error) {
req.Header.Add("User-Agent", "Vikunja/"+version.Version)
_, err = http.DefaultClient.Do(req)
client := http.DefaultClient
client.Timeout = time.Duration(config.WebhooksTimeoutSeconds.GetInt()) * time.Second
_, err = client.Do(req)
if err == nil {
log.Debugf("Sent webhook payload for webhook %d for event %s", w.ID, p.EventName)
}