mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-11 05:04:35 +00:00
run loading futures together
This commit is contained in:
parent
d5977d5d3d
commit
67c73076a2
1 changed files with 9 additions and 6 deletions
|
@ -162,18 +162,21 @@ class ExchangeDataLoadingService {
|
||||||
// await _loadChangeNowEstimatedRatePairs();
|
// await _loadChangeNowEstimatedRatePairs();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Exchanges which support Tor just get treated normally.
|
||||||
|
final futures = [
|
||||||
|
loadMajesticBankCurrencies(),
|
||||||
|
loadTrocadorCurrencies(),
|
||||||
|
];
|
||||||
|
|
||||||
// If using Tor, don't load data for exchanges which don't support Tor.
|
// If using Tor, don't load data for exchanges which don't support Tor.
|
||||||
//
|
//
|
||||||
// Add to this list when adding an exchange which doesn't supports Tor.
|
// Add to this list when adding an exchange which doesn't supports Tor.
|
||||||
if (!Prefs.instance.useTor) {
|
if (!Prefs.instance.useTor) {
|
||||||
await _loadChangeNowCurrencies();
|
futures.add(_loadChangeNowCurrencies());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exchanges which support Tor just get treated normally.
|
// wait for all loading futures to complete
|
||||||
await Future.wait([
|
await Future.wait(futures);
|
||||||
loadMajesticBankCurrencies(),
|
|
||||||
loadTrocadorCurrencies(),
|
|
||||||
]);
|
|
||||||
|
|
||||||
Logging.instance.log(
|
Logging.instance.log(
|
||||||
"ExchangeDataLoadingService.loadAll finished in ${DateTime.now().difference(start).inSeconds} seconds",
|
"ExchangeDataLoadingService.loadAll finished in ${DateTime.now().difference(start).inSeconds} seconds",
|
||||||
|
|
Loading…
Reference in a new issue