only print once

This commit is contained in:
Thibault bui Koechlin 2020-06-26 17:00:49 +02:00
parent a910d14858
commit f0b28749dc

View file

@ -17,8 +17,6 @@ func (c *Context) DeleteExpired() error {
if retx.RowsAffected > 0 { if retx.RowsAffected > 0 {
log.Infof("Flushed %d expired entries from Ban Application", retx.RowsAffected) log.Infof("Flushed %d expired entries from Ban Application", retx.RowsAffected)
} }
} else {
log.Infof("flush is disabled")
} }
return nil return nil
} }
@ -136,6 +134,9 @@ func (c *Context) AutoCommit() {
ticker := time.NewTicker(200 * time.Millisecond) ticker := time.NewTicker(200 * time.Millisecond)
cleanUpTicker := time.NewTicker(1 * time.Minute) cleanUpTicker := time.NewTicker(1 * time.Minute)
expireTicker := time.NewTicker(1 * time.Second) expireTicker := time.NewTicker(1 * time.Second)
if !c.flush {
log.Infof("flush is disabled")
}
for { for {
select { select {
case <-c.PusherTomb.Dying(): case <-c.PusherTomb.Dying():