Skip to content
This repository has been archived by the owner on Jul 15, 2018. It is now read-only.

Commit

Permalink
Merge pull request #218 from tendermint/release/v0.8.4
Browse files Browse the repository at this point in the history
Release/v0.8.4
  • Loading branch information
ebuchman authored Jun 6, 2018
2 parents d970af8 + 22541b8 commit 692f1d8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.8.4

*June 5, 2018*

IMPROVEMENTS:

- [autofile] Flush on Stop; Close() method to Flush and close file

## 0.8.3

*May 21, 2018*
Expand Down
20 changes: 16 additions & 4 deletions autofile/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ type Group struct {
// and their dependencies.
}

// OpenGroup creates a new Group with head at headPath. It returns an error if
// it fails to open head file.
func OpenGroup(headPath string) (g *Group, err error) {

dir := path.Dir(headPath)
head, err := OpenAutoFile(headPath)
if err != nil {
Expand All @@ -98,16 +99,27 @@ func OpenGroup(headPath string) (g *Group, err error) {
return
}

// OnStart implements Service by starting the goroutine that checks file and
// group limits.
func (g *Group) OnStart() error {
g.BaseService.OnStart()
go g.processTicks()
return nil
}

// NOTE: g.Head must be closed separately
// OnStop implements Service by stopping the goroutine described above.
// NOTE: g.Head must be closed separately using Close.
func (g *Group) OnStop() {
g.BaseService.OnStop()
g.ticker.Stop()
g.Flush() // flush any uncommitted data
}

// Close closes the head file. The group must be stopped by this moment.
func (g *Group) Close() {
g.Flush() // flush any uncommitted data

g.mtx.Lock()
_ = g.Head.closeFile()
g.mtx.Unlock()
}

// SetHeadSizeLimit allows you to overwrite default head size limit - 10MB.
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package version

const Version = "0.8.3"
const Version = "0.8.4"

0 comments on commit 692f1d8

Please sign in to comment.