From 70ca7ae6c7b7496f14dad27d5c6ca0af12695fc6 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 20 Nov 2019 11:32:07 -0500 Subject: [PATCH] Add more logging for update-hook stage 3 --- gitsrht-update-hook/main.go | 2 +- gitsrht-update-hook/stage-3.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gitsrht-update-hook/main.go b/gitsrht-update-hook/main.go index 87f63bd..71037e4 100644 --- a/gitsrht-update-hook/main.go +++ b/gitsrht-update-hook/main.go @@ -25,7 +25,7 @@ func main() { update() } else if os.Args[0] == "hooks/post-update" { postUpdate() - } else if os.Args[0] == "stage-3" { + } else if os.Args[0] == "hooks/stage-3" { stage3() } else { log.Fatalf("Unknown git hook %s", os.Args[0]) diff --git a/gitsrht-update-hook/stage-3.go b/gitsrht-update-hook/stage-3.go index cbabd9d..34ef916 100644 --- a/gitsrht-update-hook/stage-3.go +++ b/gitsrht-update-hook/stage-3.go @@ -54,6 +54,9 @@ func stage3() { subscriptions = append(subscriptions, whs) } + logger.Printf("Making %d deliveries and recording %d from stage 2", + len(subscriptions), len(deliveries)) + deliveries = append(deliveries, deliverWebhooks(subscriptions, payload)...) for _, delivery := range deliveries { if _, err := db.Exec(` @@ -80,4 +83,7 @@ func stage3() { logger.Fatalf("Error inserting webhook delivery: %v", err) } } + + logger.Printf("Delivered %d webhooks, recorded %d deliveries", + len(subscriptions), len(deliveries)) } -- 2.38.4