提交 7cfcda5f 编写于 作者: D dongzhihong

"fix checkpoint pointer"

上级 46c704ec
...@@ -83,7 +83,7 @@ type parameterCheckpoint struct { ...@@ -83,7 +83,7 @@ type parameterCheckpoint struct {
} }
// NewCheckpointFromFile loads parameters and state from checkpoint file // NewCheckpointFromFile loads parameters and state from checkpoint file
func NewCheckpointFromFile(cpPath string, idx int, e *EtcdClient) (*Checkpoint, error) { func NewCheckpointFromFile(cpPath string, idx int, e *EtcdClient) (Checkpoint, error) {
v, err := e.GetKey(PsPath+string(idx), 3*time.Second) v, err := e.GetKey(PsPath+string(idx), 3*time.Second)
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -110,7 +110,7 @@ func NewCheckpointFromFile(cpPath string, idx int, e *EtcdClient) (*Checkpoint, ...@@ -110,7 +110,7 @@ func NewCheckpointFromFile(cpPath string, idx int, e *EtcdClient) (*Checkpoint,
} }
dec := gob.NewDecoder(bytes.NewReader(content)) dec := gob.NewDecoder(bytes.NewReader(content))
cp := &Checkpoint{} cp := Checkpoint{}
if err = dec.Decode(cp); err != nil { if err = dec.Decode(cp); err != nil {
return nil, err return nil, err
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册