Candor.Tasks.RepeatingWorkerRoleTask.mainTimer__Elapsed C# (CSharp) Method

mainTimer__Elapsed() private method

private mainTimer__Elapsed ( object sender ) : void
sender object
return void
        void mainTimer__Elapsed(object sender)
        {
            lock (_iterationLock)
            {
                IterationResult result = null;
                try
                {
                    PauseTimer();
                    _iterationRunning = true;
                    CheckIn();
                    result = OnWaitingPeriodElapsedAdvanced();
                    _iterationRunning = false;
                    CheckIn();
                }
                catch (Exception ex)
                {
                    LogProvider.ErrorFormat("Unhandled exception executing task '{0}'", ex, Name);
                }
                finally
                {
                    try
                    {
                        _iterationRunning = false;
                        ResumeTimer(result ?? new IterationResult());
                    }
                    catch (Exception ex)
                    {
                        LogProvider.ErrorFormat("Unhandled exception resuming task '{0}'", ex, Name);
                        if (IsRunning)
                            ResetTimer();
                    }
                }
            }
        }