protected override async Task ExecuteAsync()
        {
            var latestStats = await _nexusQuery.GetInfoAsync();

            await _redisCommand.SetAsync(Settings.Redis.TimestampUtcLatest, latestStats.TimeStampUtc);

            await _redisCommand.PublishAsync(Settings.Redis.TimestampUtcLatest, latestStats.TimeStampUtc);

            Logger.LogInformation($"Latest UTC - {latestStats.TimeStampUtc:G}");
        }
Exemple #2
0
        private async Task <bool> EnsureNodeIsReady()
        {
            var nxsVersion = await _nexusQuery.GetInfoAsync();

            while (nxsVersion == null)
            {
                _logger.LogCritical("Nexus node is not available at this time.....");

                nxsVersion = await _nexusQuery.GetInfoAsync();

                await Task.Delay(TimeSpan.FromSeconds(10));
            }

            _logger.LogInformation($"Nexus node connected on version {nxsVersion.Version}");

            await _redisCommand.SetAsync(Settings.Redis.NodeVersion, nxsVersion.Version);

            return(true);
        }