Commit 057d86dd by mushishixian

修整启动项

parent 4ecfdd6a
Showing with 7 additions and 9 deletions
...@@ -4,23 +4,21 @@ import ( ...@@ -4,23 +4,21 @@ import (
"search_server/pkg/config" "search_server/pkg/config"
"search_server/pkg/gredis" "search_server/pkg/gredis"
"search_server/pkg/logger" "search_server/pkg/logger"
"search_server/pkg/mongo"
"search_server/pkg/mysql"
) )
func Boot(configPath string) (err error) { func Boot(configPath string) (err error) {
if err = config.SetUp(configPath); err != nil { if err = config.SetUp(configPath); err != nil {
panic(err) panic(err)
} }
if err = mysql.Setup(); err != nil { //if err = mysql.Setup(); err != nil {
return // return
} //}
if err = gredis.Setup(); err != nil { if err = gredis.Setup(); err != nil {
return return
} }
if err = mongo.SetUp(); err != nil { //if err = mongo.SetUp(); err != nil {
return // return
} //}
if err = logger.SetUp(); err != nil { if err = logger.SetUp(); err != nil {
return return
} }
......
...@@ -17,7 +17,7 @@ func main() { ...@@ -17,7 +17,7 @@ func main() {
if err := boot.Boot(path); err != nil { if err := boot.Boot(path); err != nil {
panic(err) panic(err)
} }
gin.SetMode(config.Get("web.mode").String())
r := gin.New() r := gin.New()
gin_.BootStrap(r) gin_.BootStrap(r)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment