Refactor code

This commit is contained in:
TwinProduction authored and Chris committed 2021-07-18 17:29:08 -04:00
1 parent a4c69d6fc3
commit 8dedcf7c74
6 files changed
+19 -26

No files matched your search

+1 -6
View File
@@ -444,12 +444,7 @@ func (s *Store) getServiceStatusByKey(tx *sql.Tx, key string, eventsPage, events
if err != nil {
return nil, err
}
serviceStatus := &core.ServiceStatus{
Name: serviceName,
Group: serviceGroup,
Key: key,
Uptime: &core.Uptime{},
}
serviceStatus := core.NewServiceStatus(key, serviceGroup, serviceName)
if eventsPageSize > 0 {
if serviceStatus.Events, err = s.getEventsByServiceID(tx, serviceID, eventsPage, eventsPageSize); err != nil {
log.Printf("[database][getServiceStatusByKey] Failed to retrieve events for key=%s: %s", key, err.Error())