diff --git a/main.go b/main.go index b16a813..cc73865 100644 --- a/main.go +++ b/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)