Skip to content

Commit

Permalink
minor but necessary fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-kripakov-m10 committed Dec 18, 2023
1 parent 2b11bcc commit 028e61d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dkron/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ type AgentOption func(agent *Agent)
// and running a Dkron instance.
func NewAgent(config *Config, options ...AgentOption) *Agent {
agent := &Agent{
config: config,
retryJoinCh: make(chan error),
config: config,
retryJoinCh: make(chan error),
serverLookup: NewServerLookup(),
}

for _, option := range options {
Expand Down Expand Up @@ -553,7 +554,6 @@ func (a *Agent) SetConfig(c *Config) {

// StartServer launch a new dkron server process
func (a *Agent) StartServer() {
a.serverLookup = NewServerLookup()
if a.Store == nil {
s, err := NewStore(a.logger)
if err != nil {
Expand Down Expand Up @@ -725,7 +725,7 @@ func (a *Agent) eventLoop() {
case serf.EventMemberReap:
a.localMemberEvent(me)
case serf.EventMemberUpdate:
a.logger.WithField("event", e.String()).Info("agent: event member update")
a.localMemberEvent(me)
case serf.EventUser, serf.EventQuery: // Ignore
default:
a.logger.WithField("event", e.String()).Warn("agent: Unhandled serf event")
Expand Down
1 change: 1 addition & 0 deletions dkron/server_lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type ServerLookup struct {

func NewServerLookup() *ServerLookup {
return &ServerLookup{
lock: sync.RWMutex{},
addressToServer: make(map[raft.ServerAddress]*ServerParts),
idToServer: make(map[raft.ServerID]*ServerParts),
}
Expand Down

0 comments on commit 028e61d

Please sign in to comment.