Skip to content

Commit

Permalink
Merge pull request #8 from sunloverz/origin/retry_when_error
Browse files Browse the repository at this point in the history
Retry handling on request timeout error(408)
  • Loading branch information
rkononov committed Dec 19, 2014
2 parents d62450f + 85ec8ff commit d997b4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/client.coffee
Expand Up @@ -117,7 +117,7 @@ class Client
else if response.statusCode == 200
cb(error, response, body)
else
if response.statusCode == 503 and retry < @MAX_RETRIES
if (response.statusCode == 503 or response.statusCode == 408) and retry < @MAX_RETRIES
delay = Math.pow(4, retry) * 100 * Math.random()
_.delay(requestBind, delay, requestInfo, cb, retry + 1)
else
Expand Down

0 comments on commit d997b4f

Please sign in to comment.