fix(server.Init) Fix wrong error reporting
We should only report error if the snapshot path is not exist and we cannot create a new one.pull/820/head
parent
a9c25bd3cc
commit
7a2b6e166e
|
@ -474,7 +474,8 @@ func (s *server) Init() error {
|
|||
}
|
||||
|
||||
// Create snapshot directory if it does not exist
|
||||
if err := os.Mkdir(path.Join(s.path, "snapshot"), 0700); err != nil {
|
||||
err := os.Mkdir(path.Join(s.path, "snapshot"), 0700)
|
||||
if err != nil && os.IsNotExist(err) {
|
||||
s.debugln("raft: Snapshot dir error: ", err)
|
||||
return fmt.Errorf("raft: Initialization error: %s", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue