Commit 195a7e74 by zihan

改为rest来请求深度

parent f083068d
...@@ -217,6 +217,7 @@ class biboxApi { ...@@ -217,6 +217,7 @@ class biboxApi {
localAddress: bindIP, localAddress: bindIP,
}; };
console.log("request with:"+bindIP);
request(options, (error, response, body) => { request(options, (error, response, body) => {
if (error) { if (error) {
callback(error); callback(error);
...@@ -226,6 +227,12 @@ class biboxApi { ...@@ -226,6 +227,12 @@ class biboxApi {
if (result.code === '200000') { if (result.code === '200000') {
callback(null, result); callback(null, result);
} else { } else {
if(result.code === '429013'){
this.allowRequest = false;
setTimeout(()=>{
this.allowRequest = true;
},60*3);
}
callback(result, null); callback(result, null);
} }
} catch (e) { } catch (e) {
......
...@@ -66,7 +66,7 @@ class KucoinCollector extends BaseCollector{ ...@@ -66,7 +66,7 @@ class KucoinCollector extends BaseCollector{
} }
} }
console.log("共有IP个数:"+ IPs.length); console.log("共有IP个数:"+ IPs.length);
const interval = Math.round(100/IPs.length); const interval = Math.round(200/IPs.length);
let index = 0; let index = 0;
setInterval(()=>{ setInterval(()=>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment