1
0
Fork 0

No snapshot is not an error

master
Philip O'Toole 10 years ago
parent 6f4a46937c
commit 55e234ee2b

@ -9,6 +9,7 @@ import (
"math/rand"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
@ -258,7 +259,9 @@ func (s *Server) ListenAndServe(leader string) error {
}
log.Info("Loading latest snapshot, if any, from disk")
if err := s.raftServer.LoadSnapshot(); err != nil {
if err := s.raftServer.LoadSnapshot(); err != nil && os.IsNotExist(err) {
log.Info("no snapshot found")
} else if err != nil {
log.Errorf("Error loading snapshot: %s", err.Error())
}

Loading…
Cancel
Save