Permalink
Browse files

Moved MAX_RETRIES to class.

  • Loading branch information...
1 parent 9eaaa39 commit 68ab5f0a94b52f8a3b9d26c51ae8b30eb7957d09 Andrew Kirilenko committed Jul 8, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/client.coffee
View
@@ -5,9 +5,9 @@ _ = require('underscore')
fs = require('fs')
request = require('request')
-MAX_RETRIES = 5
-
class Client
+ MAX_RETRIES = 5
+
constructor: (company, product, options = {}, default_options = {}, extra_options_list = []) ->
core_default_options =
user_agent: @version()
@@ -66,7 +66,7 @@ class Client
if response.statusCode == 200
cb(error, response, body)
else
- if response.statusCode == 503 and retry < MAX_RETRIES
+ if response.statusCode == 503 and retry < @MAX_RETRIES
delay = Math.pow(4, retry) * 100 * Math.random()
_.delay(request_bind, delay, request_info, cb, retry + 1)
else

0 comments on commit 68ab5f0

Please sign in to comment.