Add Service.Key() method to generate the unique service key

This commit is contained in:
TwinProduction
2021-07-11 22:22:21 -04:00
committed by Chris
parent 7aed826d65
commit 1498b6d8a2
5 changed files with 16 additions and 14 deletions

View File

@ -63,7 +63,7 @@ func (s *Store) GetServiceStatusByKey(key string) *core.ServiceStatus {
// Insert adds the observed result for the specified service into the store
func (s *Store) Insert(service *core.Service, result *core.Result) {
key := util.ConvertGroupAndServiceToKey(service.Group, service.Name)
key := service.Key()
serviceStatus, exists := s.cache.Get(key)
if !exists {
serviceStatus = core.NewServiceStatus(service)