libs/autofile: bring back loops (#2261)

* libs/autofile: bring back loops

* changelog, version
This commit is contained in:
Ethan Buchman
2018-08-31 14:05:49 -04:00
committed by GitHub
parent 013b9cef64
commit 9e940b95ad
4 changed files with 25 additions and 13 deletions
+7 -5
View File
@@ -67,11 +67,13 @@ func (af *AutoFile) Close() error {
}
func (af *AutoFile) processTicks() {
select {
case <-af.ticker.C:
af.closeFile()
case <-af.tickerStopped:
return
for {
select {
case <-af.ticker.C:
af.closeFile()
case <-af.tickerStopped:
return
}
}
}
+8 -6
View File
@@ -199,12 +199,14 @@ func (g *Group) Flush() error {
}
func (g *Group) processTicks() {
select {
case <-g.ticker.C:
g.checkHeadSizeLimit()
g.checkTotalSizeLimit()
case <-g.Quit():
return
for {
select {
case <-g.ticker.C:
g.checkHeadSizeLimit()
g.checkTotalSizeLimit()
case <-g.Quit():
return
}
}
}