Skip to content

Commit

Permalink
More temporary logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Shaw committed Jul 11, 2012
1 parent 5f0aeb0 commit bae41f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ironmq.go
Expand Up @@ -82,7 +82,7 @@ func (c *Client) req(method, endpoint string, body []byte, data interface{}) err
resp, err = http.DefaultClient.Do(req) resp, err = http.DefaultClient.Do(req)
if err != nil { if err != nil {
if err == io.EOF && eofCount < 3 { if err == io.EOF && eofCount < 3 {
golog.Debugln("Retrying because of EOF", eofCount) golog.Debugf("Retrying because of EOF %v\nPayload: %s\n", eofCount, body)
eofCount++ eofCount++
req.Body = ioutil.NopCloser(bytes.NewBuffer(body)) req.Body = ioutil.NopCloser(bytes.NewBuffer(body))
continue continue
Expand All @@ -92,7 +92,7 @@ func (c *Client) req(method, endpoint string, body []byte, data interface{}) err
// ELB sometimes returns this when load is increasing; we retry // ELB sometimes returns this when load is increasing; we retry
// with exponential backoff // with exponential backoff
if resp.StatusCode == http.StatusServiceUnavailable { if resp.StatusCode == http.StatusServiceUnavailable {
golog.Debugln("Retrying because of 503", tries) golog.Debugf("Retrying because of 503 %v\nPayload: %s\n", tries, body)
tries++ tries++
// random delay between 0 and (4^tries*100) milliseconds // random delay between 0 and (4^tries*100) milliseconds
pow := int64(1) << (2 * tries) * 100 pow := int64(1) << (2 * tries) * 100
Expand Down

0 comments on commit bae41f9

Please sign in to comment.