mirror of https://github.com/perkeep/perkeep.git
website: more debug logging
Change-Id: Idd7b42a0f518878f8b941dc79f8d94663ed4c697
This commit is contained in:
parent
d93cb4098f
commit
0c6c9d597f
|
@ -158,6 +158,7 @@ func commitEmailLoop() error {
|
||||||
select {
|
select {
|
||||||
case <-time.After(1 * time.Minute):
|
case <-time.After(1 * time.Minute):
|
||||||
case <-fetchc:
|
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)
|
log.Printf("Error running git fetch origin master in %s: %v\n%s", dir, err, out)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
log.Printf("Ran git fetch.")
|
||||||
|
// TODO: see if .git/refs/remotes/origin/master changed. quicker.
|
||||||
|
|
||||||
hashes, err := recentCommits(dir)
|
hashes, err := recentCommits(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
log.Print(err)
|
||||||
|
@ -205,12 +209,15 @@ func recentCommits(dir string) (hashes []string, err error) {
|
||||||
func mailNowHandler(w http.ResponseWriter, r *http.Request) {
|
func mailNowHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
select {
|
select {
|
||||||
case <-tokenc:
|
case <-tokenc:
|
||||||
|
log.Printf("/mailnow got a token")
|
||||||
default:
|
default:
|
||||||
// Too many requests. Ignore.
|
// Too many requests. Ignore.
|
||||||
|
log.Printf("Ignoring /mailnow request; too soon.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case fetchc <- true:
|
case fetchc <- true:
|
||||||
|
log.Printf("/mailnow triggered a git fetch")
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue