diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 746be88..0913226 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -3,6 +3,6 @@ FROM scratch MAINTAINER Michele Fadda "" -COPY lastlogin_mongodb-v4.3.3 /bin/lastlogin_mongodb +COPY lastlogin_mongodb-v4.4.1b /bin/lastlogin_mongodb ENTRYPOINT [ "/bin/lastlogin_mongodb" ] diff --git a/Docker/build.sh b/Docker/build.sh index 9bde061..2bb71cd 100755 --- a/Docker/build.sh +++ b/Docker/build.sh @@ -1,3 +1,3 @@ #!/bin/bash -docker build -t mikif70/llmongo:4.3.3 . +docker build -t mikif70/llmongo:4.4.1b . diff --git a/consumer.go b/consumer.go index 684a383..d09a2d4 100644 --- a/consumer.go +++ b/consumer.go @@ -15,6 +15,10 @@ import ( "gopkg.in/mgo.v2" ) +const ( + RETENTION = 15552000 +) + type consumed struct { user string error bool @@ -80,6 +84,16 @@ func consumer() { continue } + // se la data e' piu vecchia di RETENTION (15552000 sec) la scarta + if time.Since(time.Unix(date, 0)).Seconds()-RETENTION >= 0 { + log.Printf("Date Warning: %+v - %s - %s\n", time.Unix(date, 0), prod.user, login) + if opts.Debug { + fmt.Printf("Date Warning: %+v - %s - %s\n", time.Unix(date, 0), prod.user, login) + } else { + continue + } + } + // verifica se esiste la country if len(sval) <= 3 { sval = append(sval, "NONE") diff --git a/main.go b/main.go index 7a372b9..4e4f138 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ import ( ) const ( - _Version = "v4.3.3" + _Version = "v4.4.1b" _Producer = 0 _Consumer = 1 _Remover = 2