diff --git a/consumer.go b/consumer.go index 9507d2b..7c687cf 100644 --- a/consumer.go +++ b/consumer.go @@ -80,15 +80,16 @@ func consumer(id int) { if err != nil { log.Printf("Insert error: %+v\n", err) // se l'errore non e' "duplicate key error" salta al prossimo senza cancellare niente - if !strings.Contains(err.Error(), "E11000") { - count.AddErr() - //return - continue - } + count.AddErr() + continue + } + if retval.Updated == 1 { count.AddDuplicate() } - log.Printf("%+v - %+v\n", ml, retval) + if opts.Debug { + log.Printf("%+v - %+v\n", ml, retval) + } if i < (len(prod.logins) - 1) { cons.logins = append(cons.logins, login) diff --git a/main.go b/main.go index 7488160..630cb40 100644 --- a/main.go +++ b/main.go @@ -11,7 +11,7 @@ import ( ) const ( - _VERSION = "v2.2.2" + _VERSION = "v2.2.3" ) var (