Commit 7a91d270 by zihan

修复一个下单的重大bug

parent 23589f27
...@@ -118,20 +118,20 @@ class Order { ...@@ -118,20 +118,20 @@ class Order {
if (error) { if (error) {
console.error("搜索订单出错"); console.error("搜索订单出错");
console.error(error); console.error(error);
let timeout = 100; // let timeout = 100;
setTimeout(() => { // setTimeout(() => {
this.api.searchOrder(orderId, handleSearchResult.bind(this, orderId, symbol, side, callback)); api2.searchOrder(orderId,symbol, side, handleSearchResult.bind(this));
}, timeout); // }, timeout);
} }
if(!result || !result.data){ if(!result || !result.data){
console.error("没有返回数据,再次搜索"); console.error("没有返回数据,再次搜索");
api2.searchOrder(orderId, symbol, side, handleSearchResult.bind(this, orderId, symbol, side, callback)); api2.searchOrder(orderId, symbol, side, handleSearchResult.bind(this));
return; return;
} }
callback(null, convertToRecordOrder(result.data, price)); callback(null, convertToRecordOrder(result.data, price));
} }
this.api.searchOrder(orderId, symbol, side, handleSearchResult.bind(this, orderId, symbol, side, callback)); this.api.searchOrder(orderId, symbol, side, handleSearchResult.bind(this));
}) })
} }
} }
......
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