mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-28 20:06:24 +00:00
libs/autofile: bring back loops
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user