Simplify profile reloading

Also, increase prompt decision timeout.
This commit is contained in:
Daniel
2021-01-25 17:04:59 +01:00
parent cad957bae0
commit 9cf214fdff
12 changed files with 48 additions and 125 deletions

View File

@@ -58,6 +58,13 @@ func addActiveProfile(profile *Profile) {
activeProfilesLock.Lock()
defer activeProfilesLock.Unlock()
// Mark any previous profile as outdated.
previous, ok := activeProfiles[profile.ScopedID()]
if ok {
previous.outdated.Set()
}
// Mark new profile active and add to active profiles.
profile.MarkStillActive()
activeProfiles[profile.ScopedID()] = profile
}