protected override Task ExecuteAsync(CancellationToken cancellationToken)
        {
            bool IsWorking() => _miningQueue.IsWorking || _backgroundQueue.IsWorking;

            var lastMiningQueueWorkingValue = false;
            var lastBackgroundWorkingValue  = false;

            while (!cancellationToken.IsCancellationRequested)
            {
                try
                {
                    var mining     = lastMiningQueueWorkingValue;
                    var background = lastBackgroundWorkingValue;

                    SpinWait.SpinUntil(() =>
                                       mining != _miningQueue.IsWorking || background != _backgroundQueue.IsWorking);

                    lastMiningQueueWorkingValue = _miningQueue.IsWorking;
                    lastBackgroundWorkingValue  = _backgroundQueue.IsWorking;

                    if (!IsWorking())
                    {
                        _statisticService.RegisterWorkingStatus(true);
                        _miningService.ReMineAndSynchronizeBlocks();
                    }
                    _statisticService.RegisterWorkingStatus(IsWorking());
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }

            return(Task.CompletedTask);
        }