-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
54 lines (45 loc) · 1.1 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package main
import (
"demo-gogo/config"
"demo-gogo/database"
"demo-gogo/httpserver"
"demo-gogo/utils/redis"
"fmt"
log "github.com/wonderivan/logger"
)
func main() {
err := config.InitConfig()
if err != nil {
panic("load config with error:" + err.Error())
}
err = config.InitLog()
if err != nil {
panic("init log with error:" + err.Error())
}
err = database.InitDB()
if err != nil {
panic("init database with error:" + err.Error())
}
//if config.Conf.OSS.Type == config.CONF_OSS_MINIO {
// err = storage.InitStorage()
// if err != nil {
// panic("init storage with error:" + err.Error())
// }
//}
//err = env.InitPython()
//if err != nil {
// panic("init pythonEnv with error:" + err.Error())
//}
err = redis.InitRedis()
if err != nil {
panic("init redis with error:" + err.Error())
}
//if config.Conf.Compute.PullInterval > 0 {
// go PullCalculateProgress()
//}
server := httpserver.CreateHttpServer()
listenAddress := fmt.Sprintf("0.0.0.0:%d", config.Conf.APP.Port)
if err = server.Run(listenAddress); err != nil {
log.Error("ma_teach exit with error: %v", err)
}
}