修改配置读取
This commit is contained in:
parent
e1e7e53590
commit
301817c353
37
main.go
37
main.go
|
|
@ -60,24 +60,27 @@ func main() {
|
|||
ReadConfigToSetSystem()
|
||||
r.Run(":" + proto.Config.SERVER_PORT) // listen and serve on 0.0.0.0:8083
|
||||
}
|
||||
func init() {
|
||||
// 创建cid的目录
|
||||
os.MkdirAll(proto.CID_BASE_DIR, os.ModePerm)
|
||||
os.MkdirAll(proto.CID_BASE_DIR+"script", os.ModePerm)
|
||||
os.MkdirAll(proto.CID_BASE_DIR+"workspace", os.ModePerm)
|
||||
//读取配置文件
|
||||
//文件地址/home/videoplayer/vp.conf
|
||||
configPath := "/home/videoplayer/vp.conf"
|
||||
//读取配置文件
|
||||
err := proto.ReadConfig(configPath)
|
||||
if err != nil {
|
||||
panic("failed to read config file:" + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
// 不使用
|
||||
//
|
||||
// func init() {
|
||||
// // 创建cid的目录
|
||||
// os.MkdirAll(proto.CID_BASE_DIR, os.ModePerm)
|
||||
// os.MkdirAll(proto.CID_BASE_DIR+"script", os.ModePerm)
|
||||
// os.MkdirAll(proto.CID_BASE_DIR+"workspace", os.ModePerm)
|
||||
// //读取配置文件
|
||||
// //文件地址/home/videoplayer/vp.conf
|
||||
// configPath := "/home/videoplayer/vp.conf"
|
||||
// //读取配置文件
|
||||
// err := proto.ReadConfig(configPath)
|
||||
// if err != nil {
|
||||
// panic("failed to read config file:" + err.Error())
|
||||
// }
|
||||
// }
|
||||
func initConfig(configPath string) {
|
||||
if proto.Config.TOKEN_SECRET != "" {
|
||||
return
|
||||
}
|
||||
//if proto.Config.TOKEN_SECRET != "" {
|
||||
// return
|
||||
//}
|
||||
// 创建cid的目录
|
||||
os.MkdirAll(proto.CID_BASE_DIR, os.ModePerm)
|
||||
os.MkdirAll(proto.CID_BASE_DIR+"script", os.ModePerm)
|
||||
|
|
|
|||
Loading…
Reference in New Issue