mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 11:59:30 +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();
|
||||
*/
|
||||
|
||||
// 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.
|
||||
//
|
||||
// Add to this list when adding an exchange which doesn't supports Tor.
|
||||
if (!Prefs.instance.useTor) {
|
||||
await _loadChangeNowCurrencies();
|
||||
futures.add(_loadChangeNowCurrencies());
|
||||
}
|
||||
|
||||
// Exchanges which support Tor just get treated normally.
|
||||
await Future.wait([
|
||||
loadMajesticBankCurrencies(),
|
||||
loadTrocadorCurrencies(),
|
||||
]);
|
||||
// wait for all loading futures to complete
|
||||
await Future.wait(futures);
|
||||
|
||||
Logging.instance.log(
|
||||
"ExchangeDataLoadingService.loadAll finished in ${DateTime.now().difference(start).inSeconds} seconds",
|
||||
|
|
Loading…
Reference in a new issue