mirror of
https://github.com/aljazceru/lspd.git
synced 2025-12-21 07:44:22 +01:00
support calling multiple webhook urls
This commit is contained in:
@@ -44,6 +44,8 @@ func (s *NotificationService) Notify(
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
notified := false
|
||||||
|
for _, r := range registrations {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
err = json.NewEncoder(&buf).Encode(req)
|
err = json.NewEncoder(&buf).Encode(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -51,8 +53,6 @@ func (s *NotificationService) Notify(
|
|||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
notified := false
|
|
||||||
for _, r := range registrations {
|
|
||||||
resp, err := http.DefaultClient.Post(r, "application/json", &buf)
|
resp, err := http.DefaultClient.Post(r, "application/json", &buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Failed to send payment notification for %s to %s: %v", pubkey, r, err)
|
log.Printf("Failed to send payment notification for %s to %s: %v", pubkey, r, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user