Browse Source

Merge pull request #218 from tendermint/release/v0.8.4

Release/v0.8.4
pull/1842/head
Ethan Buchman 6 years ago
committed by GitHub
parent
commit
692f1d86a6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 5 deletions
  1. +8
    -0
      CHANGELOG.md
  2. +16
    -4
      autofile/group.go
  3. +1
    -1
      version/version.go

+ 8
- 0
CHANGELOG.md View File

@ -1,5 +1,13 @@
# Changelog # Changelog
## 0.8.4
*June 5, 2018*
IMPROVEMENTS:
- [autofile] Flush on Stop; Close() method to Flush and close file
## 0.8.3 ## 0.8.3
*May 21, 2018* *May 21, 2018*


+ 16
- 4
autofile/group.go View File

@ -71,8 +71,9 @@ type Group struct {
// and their dependencies. // 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) { func OpenGroup(headPath string) (g *Group, err error) {
dir := path.Dir(headPath) dir := path.Dir(headPath)
head, err := OpenAutoFile(headPath) head, err := OpenAutoFile(headPath)
if err != nil { if err != nil {
@ -98,16 +99,27 @@ func OpenGroup(headPath string) (g *Group, err error) {
return return
} }
// OnStart implements Service by starting the goroutine that checks file and
// group limits.
func (g *Group) OnStart() error { func (g *Group) OnStart() error {
g.BaseService.OnStart()
go g.processTicks() go g.processTicks()
return nil 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() { func (g *Group) OnStop() {
g.BaseService.OnStop()
g.ticker.Stop() 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. // SetHeadSizeLimit allows you to overwrite default head size limit - 10MB.


+ 1
- 1
version/version.go View File

@ -1,3 +1,3 @@
package version package version
const Version = "0.8.3"
const Version = "0.8.4"

Loading…
Cancel
Save