mirror of
https://github.com/vbatts/imgsrv.git
synced 2024-12-25 15:26:30 +00:00
removing unused init
This commit is contained in:
parent
9b2c342375
commit
70072f7a59
1 changed files with 1 additions and 15 deletions
16
server.go
16
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)
|
||||
|
|
Loading…
Reference in a new issue