public async void CheckForUpdates() { var ipDetails = await _ipAddressFetcher.GetCurrentIpAddressDetails(); if (AddressInfo.Ip == ipDetails.Ip) { return; } //IP Address has changed _logger.Info("Ip Address Changed - {0}", ipDetails.Ip); AddressInfo = ipDetails; UpdateIpAddressWithUnoTelly(); }
private const int _interval = 60000*30; //30 mins public IpAddressUpdaterService() { try { var fetcher = new IpAddressFetcher(); var currentIp = fetcher.GetCurrentIpAddressDetails().Result; _manager = new UpdateManager(currentIp); _logger.Info("Ip Address Service Started - Current IP {0}", currentIp.Ip); } catch (AggregateException exception) { var message = exception.InnerExceptions.Count > 0 ? exception.InnerException.Message : exception.Message; _logger.Error(message); } }
private const int _interval = 60000 * 30; //30 mins public IpAddressUpdaterService() { try { var fetcher = new IpAddressFetcher(); var currentIp = fetcher.GetCurrentIpAddressDetails().Result; _manager = new UpdateManager(currentIp); _logger.Info("Ip Address Service Started - Current IP {0}", currentIp.Ip); } catch (AggregateException exception) { var message = exception.InnerExceptions.Count > 0 ? exception.InnerException.Message : exception.Message; _logger.Error(message); } }