start the protobuf server after raft has initialized

Otherwise, we may get a protobuf request to write data to the local
shards which don't exist yet
pull/429/head
John Shahid 2014-04-11 20:35:32 -04:00
parent 69c19018e2
commit e3c55bd6a6
1 changed files with 2 additions and 2 deletions

View File

@ -75,8 +75,6 @@ func NewServer(config *configuration.Configuration) (*Server, error) {
}
func (self *Server) ListenAndServe() error {
go self.ProtobufServer.ListenAndServe()
err := self.RaftServer.ListenAndServe()
if err != nil {
return err
@ -88,6 +86,8 @@ func (self *Server) ListenAndServe() error {
time.Sleep(5 * time.Second)
go self.ProtobufServer.ListenAndServe()
log.Info("Recovering from log...")
err = self.ClusterConfig.RecoverFromWAL()
if err != nil {