Use new Group semantics

This commit is contained in:
Jae Kwon 2016-11-21 19:16:19 -08:00
parent 3206e101f5
commit e09950d3fb
2 changed files with 5 additions and 9 deletions

View File

@ -41,11 +41,7 @@ type WAL struct {
}
func NewWAL(walDir string, light bool) (*WAL, error) {
head, err := auto.OpenAutoFile(walDir + "/wal")
if err != nil {
return nil, err
}
group, err := auto.OpenGroup(head)
group, err := auto.OpenGroup(walDir + "/wal")
if err != nil {
return nil, err
}
@ -66,13 +62,13 @@ func (wal *WAL) OnStart() error {
} else if size == 0 {
wal.writeHeight(1)
}
return nil
_, err = wal.group.Start()
return err
}
func (wal *WAL) OnStop() {
wal.BaseService.OnStop()
wal.group.Head.Close()
wal.group.Close()
wal.group.Stop()
}
// called in newStep and for each pass in receiveRoutine

2
glide.lock generated
View File

@ -54,7 +54,7 @@ imports:
- name: github.com/tendermint/flowcontrol
version: 925bee8f392c28190889746f3943fe3793fb4256
- name: github.com/tendermint/go-autofile
version: dc8fa06e642c53339987acfd90154c81c1ab4c6d
version: a528af55d3c8354f676b4a5f718ab51d9b9fbb9f
- name: github.com/tendermint/go-clist
version: 3baa390bbaf7634251c42ad69a8682e7e3990552
- name: github.com/tendermint/go-common