diff --git a/cmd/service/bidcollect.go b/cmd/service/bidcollect.go index 41d7b1c..d9117ab 100644 --- a/cmd/service/bidcollect.go +++ b/cmd/service/bidcollect.go @@ -128,6 +128,7 @@ var bidCollectCmd = &cobra.Command{ OutDir: outDir, OutputTSV: outputTSV, RedisAddr: redisAddr, + UseRedis: useRedis, } bidCollector, err := bidcollect.NewBidCollector(&opts) diff --git a/services/bidcollect/bid-processor.go b/services/bidcollect/bid-processor.go index 9093d37..c55517c 100644 --- a/services/bidcollect/bid-processor.go +++ b/services/bidcollect/bid-processor.go @@ -27,6 +27,7 @@ type BidProcessorOpts struct { OutDir string OutputTSV bool RedisAddr string + UseRedis bool } type OutFiles struct { @@ -68,7 +69,7 @@ func NewBidProcessor(opts *BidProcessorOpts) (*BidProcessor, error) { c.csvFileEnding = "csv" } - if opts.RedisAddr != "" { + if opts.UseRedis && opts.RedisAddr != "" { c.redisClient = redis.NewClient(&redis.Options{ Addr: opts.RedisAddr, Password: "", // no password set diff --git a/services/bidcollect/bidcollector.go b/services/bidcollect/bidcollector.go index 44aef66..4efac2b 100644 --- a/services/bidcollect/bidcollector.go +++ b/services/bidcollect/bidcollector.go @@ -22,6 +22,7 @@ type BidCollectorOpts struct { OutputTSV bool RedisAddr string + UseRedis bool } type BidCollector struct { @@ -57,6 +58,7 @@ func NewBidCollector(opts *BidCollectorOpts) (c *BidCollector, err error) { OutDir: opts.OutDir, OutputTSV: opts.OutputTSV, RedisAddr: opts.RedisAddr, + UseRedis: opts.UseRedis, }) return c, err }