Add support for database subscription to layered profile provider

This commit is contained in:
Patrick Pacher
2020-10-30 17:01:36 +01:00
parent 079128f9de
commit 607d77a607
2 changed files with 20 additions and 4 deletions

View File

@@ -127,6 +127,12 @@ func NewLayeredProfile(localProfile *Profile) *LayeredProfile {
new.CreateMeta()
new.SetKey(runtime.DefaultRegistry.DatabaseName() + ":" + revisionProviderPrefix + localProfile.ID)
// Inform database subscribers about the new layered profile.
new.Lock()
defer new.Unlock()
pushLayeredProfile(new)
return new
}
@@ -231,6 +237,8 @@ func (lp *LayeredProfile) Update() (revisionCounter uint64) {
// bump revision counter
lp.RevisionCounter++
pushLayeredProfile(lp)
}
return lp.RevisionCounter