Пример #1
0
        public void SetServiceStatus(IServiceEntry service, string status)
        {
            var existing = GetHistoryByServiceEntry(service);

            if (existing is null)
            {
                var historyRecord = new ServiceHistory
                {
                    Id           = Guid.NewGuid(),
                    ServiceEntry = service,
                    LastStatus   = status
                };

                _historyRecords.Add(historyRecord);
            }
            else
            {
                existing.LastStatus = status;
            }
        }
Пример #2
0
        public void MarkServiceAlerted(IServiceEntry service)
        {
            var existing = GetHistoryByServiceEntry(service);

            if (existing is null)
            {
                var historyRecord = new ServiceHistory
                {
                    Id           = Guid.NewGuid(),
                    ServiceEntry = service,
                    LastAlert    = DateTimeOffset.Now
                };

                _historyRecords.Add(historyRecord);
            }
            else
            {
                existing.LastAlert = DateTimeOffset.Now;
            }
        }