public async Task Execute()
        {
            await coinDataTableStorage.Init();

            var supportedCoins = await coinDataTableStorage.GetSupportedCoins();

            foreach (var coinId in supportedCoins)
            {
                try
                {
                    var coinExplorerData = await coinExplorerService.GetData(coinId);

                    var dataPoint = mapper.Map <DataPoint>(coinExplorerData.Masternode);
                    dataPoint.CoinId = coinId;
                    dataPoint.Date   = DateTime.UtcNow.ToString("yyyyMMdd");
                    await coinDataTableStorage.AddDataPoint(dataPoint);

                    this.log.LogInformation("Recorded data point for '{0}' succesfully", coinId);
                }
                catch (Exception ex)
                {
                    this.log.LogError("Error retrieving '{0}' from Monkey Explorer and storing it in the CoinData Table Storage: {1}", coinId, ex.ToString());
                }
            }
        }
Beispiel #2
0
        public async Task Execute()
        {
            await coinDataTableStorage.Init();

            var supportedCoins = await coinDataTableStorage.GetSupportedCoins();

            foreach (var coinId in supportedCoins)
            {
                try
                {
                    var coinExplorerData = await coinExplorerService.GetData(coinId);

                    var masternodeStats = mapper.Map <MasternodeStats>(coinExplorerData.Masternode);
                    masternodeStats.CoinId      = coinId;
                    masternodeStats.Blockheight = coinExplorerData.Blockheight;
                    await coinDataTableStorage.AddMasternodeStats(masternodeStats);

                    this.log.LogInformation("Imported masternode stats for '{0}' succesfully", coinId);
                }
                catch (Exception ex)
                {
                    this.log.LogError("Error retrieving '{0}' from Monkey Explorer and storing it in the CoinData Table Storage: {1}", coinId, ex.ToString());
                }
            }
        }