add snapshot
This commit is contained in:
11
third_party/github.com/coreos/go-raft/server.go
vendored
11
third_party/github.com/coreos/go-raft/server.go
vendored
@ -1025,16 +1025,7 @@ func (s *Server) RemovePeer(name string) error {
|
||||
// Log compaction
|
||||
//--------------------------------------
|
||||
|
||||
// The background snapshot function
|
||||
func (s *Server) Snapshot() {
|
||||
for {
|
||||
// TODO: change this... to something reasonable
|
||||
time.Sleep(1 * time.Second)
|
||||
s.takeSnapshot()
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) takeSnapshot() error {
|
||||
func (s *Server) TakeSnapshot() error {
|
||||
//TODO put a snapshot mutex
|
||||
s.debugln("take Snapshot")
|
||||
if s.currentSnapshot != nil {
|
||||
|
Reference in New Issue
Block a user