Commit 576f0d0c by zihan

拿不到底仓不允许下单

parent 5ed5eefa
......@@ -15,6 +15,7 @@ class BaseCollector {
this.machine = machine;
this.balanceMap = {};
this.str2Symbols = str2Symbols;
this.balanceException = false;
}
/**
......@@ -238,6 +239,9 @@ class BaseCollector {
if(data){
this.balanceMap = {...data};
redisClient.set(this.machine,JSON.stringify(this.balanceMap),"EX",30);
this.balanceException = false;
}else{
this.balanceException = true;
}
});
setInterval(()=>{
......@@ -245,6 +249,9 @@ class BaseCollector {
if(data){
this.balanceMap = {...data};
redisClient.set(this.machine,JSON.stringify(this.balanceMap),"EX",30);
this.balanceException = false;
}else {
this.balanceException = true;
}
});
},this._runMonitorInterval());
......@@ -380,7 +387,7 @@ class BaseCollector {
// console.error("深度不足,放弃此轮");
// return false;
// }
return true;
return !this.balanceException;
}
getCurrencyBalance(currency, includeOnOrder = false) {
......
......@@ -124,6 +124,7 @@ class BiboxCollector extends BaseCollector{
if(error){
console.error("get balance by rest error:");
console.error(error);
callback(null);
return;
}else{
const balanceList = result.data.datas;
......
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