From 70072f7a591fd1b729599fa42942d84c6fc46294 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 3 Oct 2013 23:51:00 -0400 Subject: [PATCH] removing unused init --- server.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/server.go b/server.go index 1e26c32..83cc252 100644 --- a/server.go +++ b/server.go @@ -42,6 +42,7 @@ func runServer(c *config.Config) { Pass: serverConfig.MongoPassword, DbName: serverConfig.MongoDbName, } + err := du.Init() if err != nil { log.Fatal(err) @@ -68,21 +69,6 @@ func runServer(c *config.Config) { log.Fatal(http.ListenAndServe(addr, nil)) } -func initMongo() { - mongo_session, err := mgo.Dial(serverConfig.MongoHost) - if err != nil { - log.Panic(err) - } - images_db = mongo_session.DB(serverConfig.MongoDbName) - if len(serverConfig.MongoUsername) > 0 && len(serverConfig.MongoPassword) > 0 { - err = images_db.Login(serverConfig.MongoUsername, serverConfig.MongoPassword) - if err != nil { - log.Panic(err) - } - } - du.Gfs = images_db.GridFS("fs") -} - func serverErr(w http.ResponseWriter, r *http.Request, e error) { httplog.LogRequest(r, 503) log.Printf("Error: %s", e)