Beispiel #1
0
        private void Persist()
        {
            if (DateTime.UtcNow < _nextPersist)
            {
                return;
            }

            AddTextOutput("Persist");

            // Put 1 minute between persists
            _nextPersist = DateTime.UtcNow.AddMinutes(1);

            var repo = new Store();

            foreach (var alert in _alertManager.Alerts())
            {
                repo.UpdateAlert(alert);
            }

            repo.SaveChanges();
        }