From f0b28749dc143a0901a10a633284ddbf1085dd89 Mon Sep 17 00:00:00 2001 From: Thibault bui Koechlin Date: Fri, 26 Jun 2020 17:00:49 +0200 Subject: [PATCH] only print once --- pkg/sqlite/commit.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/sqlite/commit.go b/pkg/sqlite/commit.go index e76424330..c921d3212 100644 --- a/pkg/sqlite/commit.go +++ b/pkg/sqlite/commit.go @@ -17,8 +17,6 @@ func (c *Context) DeleteExpired() error { if retx.RowsAffected > 0 { log.Infof("Flushed %d expired entries from Ban Application", retx.RowsAffected) } - } else { - log.Infof("flush is disabled") } return nil } @@ -136,6 +134,9 @@ func (c *Context) AutoCommit() { ticker := time.NewTicker(200 * time.Millisecond) cleanUpTicker := time.NewTicker(1 * time.Minute) expireTicker := time.NewTicker(1 * time.Second) + if !c.flush { + log.Infof("flush is disabled") + } for { select { case <-c.PusherTomb.Dying():