Exemple #1
0
        private void TimerSignaled(object sender, System.Timers.ElapsedEventArgs e)
        {
            try
            {
                lock (_lock)
                {
                    // Load one month
                    var lastDate = _log.MaxLogDate();
                    if (DateTime.UtcNow.Subtract(lastDate) > TimeSpan.FromDays(30))
                    {
                        lastDate = DateTime.UtcNow.AddDays(-30);
                    }

                    CheckLogs(lastDate);
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Unhandled error recording log data");
            }
        }