Skip to content

Commit

Permalink
session doesn't close
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonay committed Feb 22, 2015
1 parent 3ffd34a commit f8af2c9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions handlers/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,12 @@ func InitMongo() (*mgo.Database, error) {
os.Exit(1)
}
url := uri + "/" + db_name
fmt.Println("uri: ", url)
fmt.Println("full url: ", url)
session, err := mgo.Dial(url)
if err != nil {
colorMsg := "\x1b[31;1mMongo connection failed\x1b[0m"
log.Fatalln(colorMsg, err)
}
defer session.Close()

db := session.DB(db_name)

Expand Down
Binary file modified okra
Binary file not shown.

0 comments on commit f8af2c9

Please sign in to comment.