Skip to content

Commit 5ca9912

Browse files
committed
use webhookHTTPClient.Do(req.WithContext(graceful.GetManager().ShutdownContext()))
1 parent cdb4932 commit 5ca9912

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

services/webhook/deliver.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ func Deliver(t *webhook_model.HookTask) error {
9595
return err
9696
}
9797
default:
98-
return fmt.Errorf("Invalid http method for webhook: [%d] %v", t.ID, w.HTTPMethod)
98+
return fmt.Errorf("invalid http method for webhook: [%d] %v", t.ID, w.HTTPMethod)
9999
}
100100
default:
101-
return fmt.Errorf("Invalid http method for webhook: [%d] %v", t.ID, w.HTTPMethod)
101+
return fmt.Errorf("invalid http method for webhook: [%d] %v", t.ID, w.HTTPMethod)
102102
}
103103

104104
var signatureSHA1 string
@@ -169,10 +169,10 @@ func Deliver(t *webhook_model.HookTask) error {
169169
}()
170170

171171
if setting.DisableWebhooks {
172-
return fmt.Errorf("Webhook task skipped (webhooks disabled): [%d]", t.ID)
172+
return fmt.Errorf("webhook task skipped (webhooks disabled): [%d]", t.ID)
173173
}
174174

175-
resp, err := webhookHTTPClient.Do(req)
175+
resp, err := webhookHTTPClient.Do(req.WithContext(graceful.GetManager().ShutdownContext()))
176176
if err != nil {
177177
t.ResponseInfo.Body = fmt.Sprintf("Delivery: %v", err)
178178
return err

0 commit comments

Comments
 (0)