public async Task UpdateBalances()
        {
            var wallets = (await _observableWalletRepository.GetAll()).ToList();

            foreach (var observableWallet in wallets)
            {
                await _walletBalanceService.UpdateBalance(observableWallet);
            }
        }
Esempio n. 2
0
 public async Task Execute()
 {
     foreach (var wallet in await _observableWalletRepository.GetAll())
     {
         try
         {
             await _walletBalanceService.UpdateBalance(wallet.Address);
         }
         catch (Exception e)
         {
             _log.Error(e);
         }
     }
 }
        public async Task UpdateBalances()
        {
            var wallets = (await _observableWalletRepository.GetAll()).ToList();

            foreach (var observableWallet in wallets)
            {
                try
                {
                    await _walletBalanceService.UpdateBalance(observableWallet);
                }
                catch (Exception e)
                {
                    await _log.WriteErrorAsync(nameof(UpdateBalanceFunctions), nameof(UpdateBalances), observableWallet.ToJson(), e);
                }
            }
        }
Esempio n. 4
0
        public async Task UpdateBalances()
        {
            string continuation = null;

            do
            {
                IEnumerable <IObservableWallet> wallets;
                (wallets, continuation) = (await _observableWalletRepository.GetAll(1000, continuation));
                foreach (var observableWallet in wallets)
                {
                    try
                    {
                        await _walletBalanceService.UpdateBalance(observableWallet);
                    }
                    catch (Exception e)
                    {
                        await _log.WriteErrorAsync(nameof(UpdateBalanceFunctions), nameof(UpdateBalances), observableWallet.ToJson(), e);
                    }
                }
            } while (continuation != null);
        }