modificato parametro nome DB (mongo)
This commit is contained in:
parent
58518c4b6a
commit
50b09f7050
2 changed files with 3 additions and 3 deletions
|
@ -59,9 +59,9 @@ func consumer() {
|
|||
log.Printf("Date Error: %+v - %s - %s\n", err, prod.user, login)
|
||||
continue
|
||||
}
|
||||
// genera l' _ID con user + timestamp + ip
|
||||
mlID := hash([]byte(fmt.Sprintf("%s%s%s", prod.user, time.Unix(date, 0).Format("20060102T15"), sval[2]))) // Format("20060102T150405")
|
||||
ml := MongoLogin{
|
||||
// genera l' _ID con user e timestamp
|
||||
ID: mlID,
|
||||
User: prod.user,
|
||||
Protocol: sval[0],
|
||||
|
|
4
dbs.go
4
dbs.go
|
@ -2,7 +2,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
// "fmt"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
@ -92,7 +92,7 @@ func (db *Dbs) connectMongo() {
|
|||
mongoList := strings.Split(db.MongoURI, ",")
|
||||
|
||||
for m := range mongoList {
|
||||
nm, err := mgo.Dial(mongoList[m])
|
||||
nm, err := mgo.Dial(fmt.Sprintf("mongodb://%s", mongoList[m]))
|
||||
if err != nil {
|
||||
log.Println("Mongodb connect Error: ", err.Error())
|
||||
os.Exit(-3)
|
||||
|
|
Loading…
Add table
Reference in a new issue