Skip to content

Commit

Permalink
change concurrency default value
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeljesus committed Mar 6, 2018
1 parent 537cf56 commit 2e099a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/steal.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"runtime"
"time"

"github.com/hellofresh/klepto/pkg/anonymiser"
Expand Down Expand Up @@ -36,8 +37,7 @@ type (

// NewStealCmd creates a new steal command
func NewStealCmd() *cobra.Command {
opts := &StealOptions{}

opts := new(StealOptions)
cmd := &cobra.Command{
Use: "steal",
Short: "Steals and anonymises databases",
Expand All @@ -49,14 +49,14 @@ func NewStealCmd() *cobra.Command {

cmd.PersistentFlags().StringVarP(&opts.from, "from", "f", "root:root@tcp(localhost:3306)/klepto", "Database dsn to steal from")
cmd.PersistentFlags().StringVarP(&opts.to, "to", "t", "os://stdout/", "Database to output to (default writes to stdOut)")
cmd.PersistentFlags().IntVar(&opts.concurrency, "concurrency", 4, "Sets the amount of dumps to be performed concurrently")
cmd.PersistentFlags().IntVar(&opts.concurrency, "concurrency", runtime.NumCPU(), "Sets the amount of dumps to be performed concurrently, default to number of available cpus")
cmd.PersistentFlags().StringVar(&opts.readOpts.timeout, "read-timeout", "30s", "Sets the timeout for all read operations")
cmd.PersistentFlags().StringVar(&opts.writeOpts.timeout, "write-timeout", "30s", "Sets the timeout for all write operations")
cmd.PersistentFlags().StringVar(&opts.readOpts.maxConnLifetime, "read-conn-lifetime", "0", "Sets the maximum amount of time a connection may be reused on the read database")
cmd.PersistentFlags().IntVar(&opts.readOpts.maxConns, "read-max-conns", 10, "Sets the maximum number of open connections to the read database")
cmd.PersistentFlags().IntVar(&opts.readOpts.maxConns, "read-max-conns", 5, "Sets the maximum number of open connections to the read database")
cmd.PersistentFlags().IntVar(&opts.readOpts.maxIdleConns, "read-max-idle-conns", 0, "Sets the maximum number of connections in the idle connection pool for the read database")
cmd.PersistentFlags().StringVar(&opts.writeOpts.maxConnLifetime, "write-conn-lifetime", "0", "Sets the maximum amount of time a connection may be reused on the write database")
cmd.PersistentFlags().IntVar(&opts.writeOpts.maxConns, "write-max-conns", 10, "Sets the maximum number of open connections to the write database")
cmd.PersistentFlags().IntVar(&opts.writeOpts.maxConns, "write-max-conns", 5, "Sets the maximum number of open connections to the write database")
cmd.PersistentFlags().IntVar(&opts.writeOpts.maxIdleConns, "write-max-idle-conns", 0, "Sets the maximum number of connections in the idle connection pool for the write database")
return cmd
}
Expand Down

0 comments on commit 2e099a8

Please sign in to comment.