From 0c6c9d597f553742cab485bab54b8f2af0cb97cc Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 23 Aug 2013 00:03:07 -0500 Subject: [PATCH] website: more debug logging Change-Id: Idd7b42a0f518878f8b941dc79f8d94663ed4c697 --- website/email.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/website/email.go b/website/email.go index 80ca53394..4dd1dafb4 100644 --- a/website/email.go +++ b/website/email.go @@ -158,6 +158,7 @@ func commitEmailLoop() error { select { case <-time.After(1 * time.Minute): case <-fetchc: + log.Printf("Polling git due to explicit trigger.") } } } @@ -170,6 +171,9 @@ func pollCommits(dir string) { log.Printf("Error running git fetch origin master in %s: %v\n%s", dir, err, out) return } + log.Printf("Ran git fetch.") + // TODO: see if .git/refs/remotes/origin/master changed. quicker. + hashes, err := recentCommits(dir) if err != nil { log.Print(err) @@ -205,12 +209,15 @@ func recentCommits(dir string) (hashes []string, err error) { func mailNowHandler(w http.ResponseWriter, r *http.Request) { select { case <-tokenc: + log.Printf("/mailnow got a token") default: // Too many requests. Ignore. + log.Printf("Ignoring /mailnow request; too soon.") return } select { case fetchc <- true: + log.Printf("/mailnow triggered a git fetch") default: } }