@icgio/icg-exchanges-wrapper 1.14.171 → 1.14.172
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/middleware/orders.js +6 -5
- package/package.json +1 -1
package/middleware/orders.js
CHANGED
|
@@ -181,7 +181,7 @@ module.exports = class Orders {
|
|
|
181
181
|
positions_check: false,
|
|
182
182
|
open_orders_check: true,
|
|
183
183
|
trades_check: true,
|
|
184
|
-
|
|
184
|
+
query_order_check_old_orders: true,
|
|
185
185
|
query_order_check_exchange: {},
|
|
186
186
|
rates_check: true,
|
|
187
187
|
market_history_check: true,
|
|
@@ -201,7 +201,7 @@ module.exports = class Orders {
|
|
|
201
201
|
this.trades_amount_past_hour = {}
|
|
202
202
|
this.check_trades()
|
|
203
203
|
}
|
|
204
|
-
if (this.function_enabled.
|
|
204
|
+
if (this.function_enabled.query_order_check_old_orders) {
|
|
205
205
|
for (let exchange in this.Exchanges) {
|
|
206
206
|
if (this.function_enabled.query_order_check_exchange[exchange]) {
|
|
207
207
|
this.check_query_order(exchange)
|
|
@@ -226,7 +226,7 @@ module.exports = class Orders {
|
|
|
226
226
|
this.process_open_orders(this.open_orders)
|
|
227
227
|
}, PROCESS_OPEN_ORDERS_TRADERS_INTERVAL_MS)
|
|
228
228
|
}
|
|
229
|
-
if (this.function_enabled.
|
|
229
|
+
if (this.function_enabled.query_order_check_old_orders) {
|
|
230
230
|
setInterval(() => {
|
|
231
231
|
this.process_query_order(this.query_order)
|
|
232
232
|
}, PROCESS_OPEN_ORDERS_TRADERS_INTERVAL_MS)
|
|
@@ -1145,8 +1145,8 @@ module.exports = class Orders {
|
|
|
1145
1145
|
get_trades_all(this.Exchanges, this.exchange_pairs, this.interval_dict)
|
|
1146
1146
|
}
|
|
1147
1147
|
check_query_order(exchange) {
|
|
1148
|
-
|
|
1149
|
-
const QUERY_ORDER_TIME_IN_MS = 0
|
|
1148
|
+
const QUERY_ORDER_TIME_IN_MS = 30 * 60 * 1000
|
|
1149
|
+
// const QUERY_ORDER_TIME_IN_MS = 0
|
|
1150
1150
|
let query_order_handler = (exchange, pair, res) => {
|
|
1151
1151
|
if (res.success) {
|
|
1152
1152
|
_.set(this.query_order, [exchange, pair], { query_order: res.body, update_time: new Date() })
|
|
@@ -1171,6 +1171,7 @@ module.exports = class Orders {
|
|
|
1171
1171
|
let { open_time } = order_info[type][order_id]
|
|
1172
1172
|
// console.log(order_id, open_time, open_time < new Date() - 30 * 60 * 1000)
|
|
1173
1173
|
if (open_time < new Date() - QUERY_ORDER_TIME_IN_MS) {
|
|
1174
|
+
console.log('query_order_old_orders: %s %s %s', exchange, pair, order_id)
|
|
1174
1175
|
Exchanges[exchange].query_order(pair, order_id, (res) => {
|
|
1175
1176
|
count++
|
|
1176
1177
|
if (res.success) {
|