enable peer payload update

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2018-11-29 22:57:26 -05:00
parent f8763a7a16
commit db23484f9f
No known key found for this signature in database
GPG key ID: A519480096146526

View file

@ -5,6 +5,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/gogo/protobuf/types"
"github.com/hashicorp/memberlist" "github.com/hashicorp/memberlist"
) )
@ -66,6 +67,11 @@ func (a *Agent) SyncInterval() time.Duration {
return a.memberConfig.PushPullInterval return a.memberConfig.PushPullInterval
} }
// Update updates the agent payload
func (a *Agent) Update(payload *types.Any) {
a.state.Self.Payload = payload
}
func newSubscribers() *subscribers { func newSubscribers() *subscribers {
return &subscribers{ return &subscribers{
subs: make(map[chan *NodeEvent]struct{}), subs: make(map[chan *NodeEvent]struct{}),