Пример #1
0
 public void Start()
 {
     if (_isLockedByPolicy)
     {
         _pollerContext.Logger.Warn($"Runner for poller {Poller.GetType().FullName} is locked and can't be started. Use ForceStart.");
     }
     else
     {
         _pollerContext.Logger.Trace(Poller.RunForDuration != null
                                     // ReSharper disable once PossibleInvalidOperationException
             ? $"Starting runner for poller {Poller.GetType().FullName} for duration {Poller.RunForDuration.Value.TotalMinutes} minute(s)..."
             : $"Starting runner for poller {Poller.GetType().FullName}...");
         _startedAt.Set(DateTime.UtcNow);
         if (_isRunning)
         {
             return;
         }
         _pollerContext.Logger.Debug(Poller.RunForDuration != null
                                     // ReSharper disable once PossibleInvalidOperationException
             ? $"Runner for poller {Poller.GetType().FullName} for duration {Poller.RunForDuration.Value.TotalMinutes} minute(s) started."
             : $"Runner for poller {Poller.GetType().FullName} started.");
         _runnerTimer.Start();
         _isRunning = true;
     }
 }
Пример #2
0
 public void Start()
 {
     _startedAt.Set(DateTime.UtcNow);
     if (_isRunning)
     {
         return;
     }
     _isRunning = true;
     _timer.Start();
     _logger.Debug("Linearizer for duration {0} minute(s) started.", _durationWork.TotalMinutes);
 }
Пример #3
0
        public void Start()
        {
            _startedAt.Set(DateTime.UtcNow);
            if (_isRunning)
            {
                return;
            }
            _runnerTimer.Start();
            _isRunning = true;

            Projector.Logger.Debug("Projector '{0}' for duration {1} minute(s) started.", Projector.Name, RunForDuration.TotalMinutes);
        }
Пример #4
0
        /// <inheritdoc />
        public void Start()
        {
            if (_timer == null)
            {
                return;
            }
            if (Timeout == TimeSpan.Zero)
            {
                throw new InvalidOperationException("Set Timeout greater than Zero.");
            }

            _startedAt.Set(DateTime.UtcNow);
            if (_isWorking)
            {
                return;
            }
            _isWorking = true;
            _timer.Start();
            Logger.Debug("Linearizer for duration {0} minute(s) started.", Math.Round(WorkDuration.TotalMinutes, 2));
        }