diff --git a/.gitignore b/.gitignore index 5b26fc3..7ef32b1 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ docker-compose.yml .TODO.md dist/ +cmd/dnsmonster/dnsmonster diff --git a/cmd/dnsmonster/dnsmonster b/cmd/dnsmonster/dnsmonster deleted file mode 100755 index 1d820a2..0000000 Binary files a/cmd/dnsmonster/dnsmonster and /dev/null differ diff --git a/internal/output/clickhouse.go b/internal/output/clickhouse.go index 20796f7..5ec988f 100644 --- a/internal/output/clickhouse.go +++ b/internal/output/clickhouse.go @@ -157,8 +157,6 @@ func (chConfig clickhouseConfig) clickhouseOutputWorker(ctx context.Context) err c := uint(0) - now := time.Now() - ticker := time.NewTicker(time.Second * 5) div := 0 @@ -199,7 +197,7 @@ func (chConfig clickhouseConfig) clickhouseOutputWorker(ctx context.Context) err } err := batch.Append( data.Timestamp, - now, + time.Now(), util.GeneralFlags.ServerName, data.IPVersion, data.SrcIP.To16(), @@ -221,7 +219,6 @@ func (chConfig clickhouseConfig) clickhouseOutputWorker(ctx context.Context) err clickhouseFailed.Inc(1) } if int(c%chConfig.ClickhouseBatchSize) == div { - now = time.Now() err = batch.Send() if err != nil { log.Warnf("Error while executing batch: %v", err) @@ -232,7 +229,6 @@ func (chConfig clickhouseConfig) clickhouseOutputWorker(ctx context.Context) err } } case <-ticker.C: - now = time.Now() err := batch.Send() if err != nil { log.Warnf("Error while executing batch: %v", err)