init
This commit is contained in:
1 parent
48eaf48797
commit
e32e55df15
20 files changed
+369
-117
No files matched your search
+2
-2
@@ -83,7 +83,7 @@ func (r *Raft) listenLeader() {
|
||||
}
|
||||
}
|
||||
|
||||
func NewRaft(bind string, configuration conf.ClusterConfiguration) (*Raft, error) {
|
||||
func NewRaft(bind string, configuration conf.ClusterConfiguration, state raft.FSM) (*Raft, error) {
|
||||
logStore, store, snapshotStore, err := makeStores(configuration)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -100,7 +100,7 @@ func NewRaft(bind string, configuration conf.ClusterConfiguration) (*Raft, error
|
||||
|
||||
cfg := raft.DefaultConfig()
|
||||
cfg.LocalID = raft.ServerID(configuration.OuterAddress)
|
||||
r, err := raft.NewRaft(cfg, nil, logStore, store, snapshotStore, trans)
|
||||
r, err := raft.NewRaft(cfg, state, logStore, store, snapshotStore, trans)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "create raft")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user