bump(goraft/raft): f94d98c
This commit is contained in:
6
third_party/github.com/goraft/raft/log.go
vendored
6
third_party/github.com/goraft/raft/log.go
vendored
@ -27,6 +27,7 @@ type Log struct {
|
||||
mutex sync.RWMutex
|
||||
startIndex uint64 // the index before the first entry in the Log entries
|
||||
startTerm uint64
|
||||
initialized bool
|
||||
}
|
||||
|
||||
// The results of the applying a log entry.
|
||||
@ -147,7 +148,9 @@ func (l *Log) open(path string) error {
|
||||
if os.IsNotExist(err) {
|
||||
l.file, err = os.OpenFile(path, os.O_WRONLY|os.O_CREATE, 0600)
|
||||
debugln("log.open.create ", path)
|
||||
|
||||
if err == nil {
|
||||
l.initialized = true
|
||||
}
|
||||
return err
|
||||
}
|
||||
return err
|
||||
@ -187,6 +190,7 @@ func (l *Log) open(path string) error {
|
||||
readBytes += int64(n)
|
||||
}
|
||||
debugln("open.log.recovery number of log ", len(l.entries))
|
||||
l.initialized = true
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user