diff --git a/lib/request.js b/lib/request.js index e7a3071..4060b5f 100644 --- a/lib/request.js +++ b/lib/request.js @@ -7,7 +7,7 @@ var querystring = require('querystring'), var request = function(options, params, callback) { if (requestCount == config.requestLimit) { - setTimeout(request, config.requestStep, options, params, callback); + setTimeout(request, config.requestTimeout, options, params, callback); return; } requestCount++; @@ -20,7 +20,7 @@ var request = function(options, params, callback) { } catch (err) { callback(err); } finally { - setTimeout(fnReduceRequestCount, config.requestLimit * config.requestStep * eval(res.headers['x-yhsd-shop-api-call-limit'])); + setTimeout(fnReduceRequestCount, config.requestLimit * config.requestTimeout * eval(res.headers['x-yhsd-shop-api-call-limit'])); } callback(null, data); });