Implement review suggestions

This commit is contained in:
Daniel
2021-01-28 16:44:40 +01:00
parent ee9ee3dc68
commit 6233c76778
6 changed files with 9 additions and 9 deletions

View File

@@ -59,8 +59,7 @@ func addActiveProfile(profile *Profile) {
defer activeProfilesLock.Unlock()
// Mark any previous profile as outdated.
previous, ok := activeProfiles[profile.ScopedID()]
if ok {
if previous, ok := activeProfiles[profile.ScopedID()]; ok {
previous.outdated.Set()
}

View File

@@ -30,7 +30,9 @@ var getProfileSingleInflight singleflight.Group
// GetProfile fetches a profile. This function ensures that the loaded profile
// is shared among all callers. You must always supply both the scopedID and
// linkedPath parameters whenever available.
// linkedPath parameters whenever available. The linkedPath is used as the key
// for locking concurrent requests, so it must be supplied if available.
// If linkedPath is not supplied, source and id make up the key instead.
func GetProfile(source profileSource, id, linkedPath string) ( //nolint:gocognit
profile *Profile,
err error,