mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-22 07:53:38 +01:00
Update storage/memory.go
Co-authored-by: Chris C. <twin@twinnation.org>
This commit is contained in:
parent
0af8837710
commit
fc4858b1a8
@ -43,11 +43,8 @@ func (ims *InMemoryStore) GetAll() map[string]*core.ServiceStatus {
|
|||||||
func (ims *InMemoryStore) GetServiceStatus(group, name string) *core.ServiceStatus {
|
func (ims *InMemoryStore) GetServiceStatus(group, name string) *core.ServiceStatus {
|
||||||
key := fmt.Sprintf("%s_%s", group, name)
|
key := fmt.Sprintf("%s_%s", group, name)
|
||||||
ims.serviceResultsMutex.RLock()
|
ims.serviceResultsMutex.RLock()
|
||||||
serviceStatus, exists := ims.serviceStatuses[key]
|
serviceStatus := ims.serviceStatuses[key]
|
||||||
ims.serviceResultsMutex.RUnlock()
|
ims.serviceResultsMutex.RUnlock()
|
||||||
if !exists {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return serviceStatus
|
return serviceStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user