eliminata la gestione del PID
This commit is contained in:
parent
73cfd49a17
commit
fed914f2cc
2 changed files with 2 additions and 10 deletions
6
main.go
6
main.go
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
_Version = "v2.2.1"
|
_Version = "v2.2.2"
|
||||||
_Producer = 0
|
_Producer = 0
|
||||||
_Consumer = 1
|
_Consumer = 1
|
||||||
)
|
)
|
||||||
|
@ -55,10 +55,6 @@ func main() {
|
||||||
|
|
||||||
log.SetOutput(fs)
|
log.SetOutput(fs)
|
||||||
|
|
||||||
pid.PIDFile = opts.Pidfile
|
|
||||||
pid.Write(true)
|
|
||||||
defer pid.Remove()
|
|
||||||
|
|
||||||
start = time.Now()
|
start = time.Now()
|
||||||
fmt.Printf("Start: %+v\n\t%+v\n", opts, dbs)
|
fmt.Printf("Start: %+v\n\t%+v\n", opts, dbs)
|
||||||
log.Printf("Start: %+v\n\t%+v\n", opts, dbs)
|
log.Printf("Start: %+v\n\t%+v\n", opts, dbs)
|
||||||
|
|
|
@ -24,7 +24,6 @@ type Options struct {
|
||||||
Version bool
|
Version bool
|
||||||
MaxBulk int
|
MaxBulk int
|
||||||
Month string
|
Month string
|
||||||
Pidfile string
|
|
||||||
Queue int
|
Queue int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +43,6 @@ func usage() {
|
||||||
-i <influxdb [localname@ip:port]>
|
-i <influxdb [localname@ip:port]>
|
||||||
-l <logfile>
|
-l <logfile>
|
||||||
-T <running ttl>
|
-T <running ttl>
|
||||||
-p <pid filename>
|
|
||||||
-M <bulk size>
|
-M <bulk size>
|
||||||
-q <num consumer>
|
-q <num consumer>
|
||||||
-v`)
|
-v`)
|
||||||
|
@ -60,7 +58,6 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
opts.LogFile = path.Join(opts.CurrentPath, opts.LogFile)
|
opts.LogFile = path.Join(opts.CurrentPath, opts.LogFile)
|
||||||
opts.Pidfile = path.Join(opts.CurrentPath, "run", path.Base(os.Args[0])+".pid")
|
|
||||||
opts.Exe = path.Base(os.Args[0])
|
opts.Exe = path.Base(os.Args[0])
|
||||||
|
|
||||||
flag.StringVar(&dbs.MongoURI, "m", "", "Mongodb")
|
flag.StringVar(&dbs.MongoURI, "m", "", "Mongodb")
|
||||||
|
@ -73,7 +70,6 @@ func init() {
|
||||||
flag.DurationVar(&opts.Timeout, "T", 0, "Running timeout")
|
flag.DurationVar(&opts.Timeout, "T", 0, "Running timeout")
|
||||||
flag.BoolVar(&opts.Debug, "D", false, "Debug")
|
flag.BoolVar(&opts.Debug, "D", false, "Debug")
|
||||||
flag.BoolVar(&opts.Test, "DD", false, "Test")
|
flag.BoolVar(&opts.Test, "DD", false, "Test")
|
||||||
flag.IntVar(&opts.MaxBulk, "M", 1000, "Max Mongodb bulk")
|
flag.IntVar(&opts.MaxBulk, "M", 500, "Max Mongodb bulk")
|
||||||
flag.IntVar(&opts.Queue, "q", 2, "parallel consumer")
|
flag.IntVar(&opts.Queue, "q", 2, "parallel consumer")
|
||||||
flag.StringVar(&opts.Pidfile, "p", opts.Pidfile, "pid file")
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue