Broadcast attributes update. (#2825)
This commit is contained in:
@@ -461,6 +461,9 @@ func (p *ParticipantImpl) SetMetadata(metadata string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) SetAttributes(attrs map[string]string) error {
|
func (p *ParticipantImpl) SetAttributes(attrs map[string]string) error {
|
||||||
|
if len(attrs) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
grants := p.grants.Load().Clone()
|
grants := p.grants.Load().Clone()
|
||||||
if grants.Attributes == nil {
|
if grants.Attributes == nil {
|
||||||
@@ -491,6 +494,7 @@ func (p *ParticipantImpl) SetAttributes(attrs map[string]string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p.grants.Store(grants)
|
p.grants.Store(grants)
|
||||||
|
p.requireBroadcast = true // already checked above
|
||||||
p.dirty.Store(true)
|
p.dirty.Store(true)
|
||||||
|
|
||||||
onParticipantUpdate := p.onParticipantUpdate
|
onParticipantUpdate := p.onParticipantUpdate
|
||||||
|
|||||||
Reference in New Issue
Block a user