protected override async Task ExecuteAsync()

in src/Epam.Kafka.PubSub/Common/PubSubBackgroundService.cs [58:89]


    protected override async Task ExecuteAsync(CancellationToken stoppingToken)
    {
        await Task.Yield();

        if (!this.Options.Enabled)
        {
            this.Monitor.Pipeline.Update(PipelineStatus.Disabled);
            return;
        }

        try
        {
            this.WaitDependencies(stoppingToken);
        }
        catch (Exception exception)
        {
            if (stoppingToken.IsCancellationRequested)
            {
                this.Monitor.Pipeline.Update(PipelineStatus.Cancelled);
            }
            else
            {
                this.Monitor.Pipeline.Update(PipelineStatus.Failed);

                this.Logger.PipelineFailed(exception, this.Monitor.Name);
            }

            throw;
        }

        this.ExecutePipeline(stoppingToken);
    }