NLog.Targets.FileTarget.AutoClosingTimerCallback C# (CSharp) Method

AutoClosingTimerCallback() private method

private AutoClosingTimerCallback ( object state ) : void
state object
return void
        private void AutoClosingTimerCallback(object state)
        {
            try
            {
                lock (this.SyncRoot)
                {
                    if (!this.IsInitialized)
                    {
                        return;
                    }

                    DateTime expireTime = DateTime.UtcNow.AddSeconds(-this.OpenFileCacheTimeout);
                    this.fileAppenderCache.CloseAppenders(expireTime);
                }
            }
            catch (Exception exception)
            {
                InternalLogger.Warn(exception, "Exception in AutoClosingTimerCallback.");

                if (exception.MustBeRethrownImmediately())
                {
                    throw;  // Throwing exceptions here will crash the entire application (.NET 2.0 behavior)
                }
            }
        }