Skip to content

Commit

Permalink
fix api request timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
muguang-lijing authored Oct 27, 2016
1 parent d0b6d49 commit f19b0a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand All @@ -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);
});
Expand Down

0 comments on commit f19b0a6

Please sign in to comment.