1
0
Fork 0
mirror of https://github.com/vbatts/imgsrv.git synced 2025-01-12 15:17:07 +00:00

removing unused init

This commit is contained in:
Vincent Batts 2013-10-03 23:51:00 -04:00
parent 9b2c342375
commit 70072f7a59

View file

@ -42,6 +42,7 @@ func runServer(c *config.Config) {
Pass: serverConfig.MongoPassword, Pass: serverConfig.MongoPassword,
DbName: serverConfig.MongoDbName, DbName: serverConfig.MongoDbName,
} }
err := du.Init() err := du.Init()
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
@ -68,21 +69,6 @@ func runServer(c *config.Config) {
log.Fatal(http.ListenAndServe(addr, nil)) 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) { func serverErr(w http.ResponseWriter, r *http.Request, e error) {
httplog.LogRequest(r, 503) httplog.LogRequest(r, 503)
log.Printf("Error: %s", e) log.Printf("Error: %s", e)