From f19b0a681cdefd065025274b373226f66f386421 Mon Sep 17 00:00:00 2001 From: muguang-lijing Date: Thu, 27 Oct 2016 16:51:44 +0800 Subject: [PATCH] fix api request timeout --- lib/request.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); });