Skip to content

Commit

Permalink
fix panic on recovering cluster (with peers.json) (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
fopina committed Jan 6, 2021
1 parent a29bbb7 commit 8c9b146
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dkron/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,11 @@ func (a *Agent) setupRaft() error {
if err != nil {
return fmt.Errorf("recovery failed to parse peers.json: %v", err)
}
tmpFsm := newFSM(nil, nil)
store, err := NewStore()
if err != nil {
log.WithError(err).Fatal("dkron: Error initializing store")
}
tmpFsm := newFSM(store, nil)
if err := raft.RecoverCluster(config, tmpFsm,
logStore, stableStore, snapshots, transport, configuration); err != nil {
return fmt.Errorf("recovery failed: %v", err)
Expand Down

0 comments on commit 8c9b146

Please sign in to comment.