Implement review suggestions
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user