@icgio/icg-exchanges-wrapper 1.15.0 → 1.15.2
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.
|
@@ -700,12 +700,13 @@ const get_exchanges_market_history = function (Exchanges, exchange_pair_dict, ti
|
|
|
700
700
|
|
|
701
701
|
let checked_ohlcv_exchange = {},
|
|
702
702
|
ohlcv_status = {},
|
|
703
|
+
ohlcv_callback_fired = false, // Separate flag to prevent multiple callback calls
|
|
703
704
|
exchange_pair_ohlcv = {},
|
|
704
705
|
pair_exchange_ohlcv = {}
|
|
705
706
|
const get_exchanges_ohlcv = function (Exchanges, exchange_pair_dict, from_in_ms, to_in_ms, cb) {
|
|
706
707
|
checked_ohlcv_exchange = {}
|
|
707
708
|
ohlcv_status = {}
|
|
708
|
-
|
|
709
|
+
ohlcv_callback_fired = false // Reset callback flag (separate from ohlcv_status to not pollute _.values())
|
|
709
710
|
if (!Array.isArray(Exchanges)) {
|
|
710
711
|
console.error('Exchanges should be an array')
|
|
711
712
|
return
|
|
@@ -731,16 +732,16 @@ const get_exchanges_ohlcv = function (Exchanges, exchange_pair_dict, from_in_ms,
|
|
|
731
732
|
}
|
|
732
733
|
_.set(ohlcv_status, [Exchange_name + pair], true)
|
|
733
734
|
// Use a flag to prevent multiple callback calls
|
|
734
|
-
if (!_.includes(_.values(ohlcv_status), false) && !
|
|
735
|
-
|
|
735
|
+
if (!_.includes(_.values(ohlcv_status), false) && !ohlcv_callback_fired) {
|
|
736
|
+
ohlcv_callback_fired = true
|
|
736
737
|
cb({ exchange_pair_ohlcv, pair_exchange_ohlcv })
|
|
737
738
|
}
|
|
738
739
|
})
|
|
739
740
|
} else {
|
|
740
741
|
_.set(ohlcv_status, [Exchange_name + pair], true)
|
|
741
742
|
// Use a flag to prevent multiple callback calls
|
|
742
|
-
if (!_.includes(_.values(ohlcv_status), false) && !
|
|
743
|
-
|
|
743
|
+
if (!_.includes(_.values(ohlcv_status), false) && !ohlcv_callback_fired) {
|
|
744
|
+
ohlcv_callback_fired = true
|
|
744
745
|
cb({ exchange_pair_ohlcv, pair_exchange_ohlcv })
|
|
745
746
|
}
|
|
746
747
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icgio/icg-exchanges-wrapper",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/icgio/icg-exchanges-wrapper#readme",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@icgio/icg-exchanges": "^1.32.
|
|
20
|
+
"@icgio/icg-exchanges": "^1.32.140",
|
|
21
21
|
"@icgio/icg-utils": "^1.9.44",
|
|
22
22
|
"lodash": "^4.17.23",
|
|
23
23
|
"pg": "^8.17.2"
|