Merge pull request #333 from safing/fix/profile-deadlock

Fix profile deadlock
This commit is contained in:
Daniel
2021-06-07 12:02:38 +02:00
committed by GitHub

View File

@@ -301,19 +301,15 @@ func (profile *Profile) IsOutdated() bool {
return profile.outdated.IsSet()
}
// GetEndpoints returns the endpoint list of the profile.
// GetEndpoints returns the endpoint list of the profile. This functions
// requires the profile to be read locked.
func (profile *Profile) GetEndpoints() endpoints.Endpoints {
profile.RLock()
defer profile.RUnlock()
return profile.endpoints
}
// GetServiceEndpoints returns the service endpoint list of the profile.
// GetServiceEndpoints returns the service endpoint list of the profile. This
// functions requires the profile to be read locked.
func (profile *Profile) GetServiceEndpoints() endpoints.Endpoints {
profile.RLock()
defer profile.RUnlock()
return profile.serviceEndpoints
}