【发布时间】:2014-11-11 21:16:52
【问题描述】:
我遇到了速率限制达到错误 (429)。我正在解析一个 TSV 文件并遍历每一行,执行请求。举个例子:
(function () {
'use strict';
var
csv = require('csv'),
fs = require('fs'),
paypal = require('paypal-rest-sdk'),
parser = csv.parse({ columns: true, delimiter: '\t' }, function (error, data) {
if (error) {
console.log(error.response);
throw error;
}
data.forEach(function (invoice) {
paypal.invoice.send(invoice.id, function (error, response) {
if (error) {
console.log(error.response);
throw error;
}
console.log('---- Invoice Send Response ----');
console.log(response);
});
});
});
require('./configure');
fs.createReadStream('./temp.tsv').pipe(parser);
}());
有人用 PayPal REST API 做过类似的事情吗?有什么建议吗?
【问题讨论】: