usa la collection: lastlogin.lastlogin_yymm

This commit is contained in:
Miki 2016-05-09 12:10:27 +02:00
parent 2778e5506b
commit b97098e78b
2 changed files with 7 additions and 9 deletions

View file

@ -13,7 +13,7 @@ import (
)
const (
_VERSION = "v1.3.7"
_VERSION = "v1.4.0"
_tformat = "2006-01-02"
_24h = (time.Hour * 23) + (time.Minute * 59) + (time.Second * 59) + (time.Millisecond * 999)
_10m = (time.Minute * 10)
@ -74,24 +74,22 @@ func main() {
fmt.Printf("Start: %+v\n", opts)
log.Printf("Start: %+v\n", opts)
connectMongo()
defer dbs.mdbSrc.Close()
defer dbs.mdbDst.Close()
y, err := time.Parse(_tformat, opts.StartDate)
if err != nil {
log.Println("Date Error: ", err)
os.Exit(-1)
}
var ys time.Time
var ye time.Time
ys = time.Date(y.Year(), y.Month(), y.Day(), 0, 0, 0, 0, time.UTC)
ye = ys.Add(opts.Duration)
idb = Influxdb(start, ys)
connectMongo(ys.Format("0601"))
defer dbs.mdbSrc.Close()
defer dbs.mdbDst.Close()
// DEBUG
if opts.Debug {
fmt.Printf("Start: %+v, Stop: %+v\n\r", ys, ye)