示例#1
0
        public async Task ProcessAsync(ProcessingContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (!_register.IsHealthy())
            {
                _register.ReStart();
            }

            await context.WaitAsync(_waitingInterval);
        }
        public async Task ProcessAsync(ProcessingContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            _logger.LogDebug("Transport connection checking...");

            if (!_register.IsHealthy())
            {
                _logger.LogWarning("Transport connection is unhealthy, reconnection...");

                _register.ReStart();
            }
            else
            {
                _logger.LogDebug("Transport connection healthy!");
            }

            await context.WaitAsync(_waitingInterval);
        }