Skip to content

Commit

Permalink
Log timeout outcome
Browse files Browse the repository at this point in the history
  • Loading branch information
sqs committed Oct 31, 2013
1 parent d27b2c1 commit cdb539f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion static_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ func (h *StaticRenderer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
for {
if time.Since(start) > h.WaitTimeout {
if h.ReturnUnfinishedPages {
h.logf("Page at URL %s did not set $renderStaticReady within timeout %s; returning unfinished page", targetURL, h.WaitTimeout)
break
}
h.logf("Page at URL %s did not set $renderStaticReady within timeout %s", targetURL, h.WaitTimeout)
h.logf("Page at URL %s did not set $renderStaticReady within timeout %s; returning HTTP error", targetURL, h.WaitTimeout)
http.Error(w, "No response from origin server within "+h.WaitTimeout.String(), http.StatusBadGateway)
return
}
Expand Down

0 comments on commit cdb539f

Please sign in to comment.