|
@@ -20,16 +20,26 @@ var (
|
|
|
|
|
|
const ConfigFile = "config/config_debug.yaml" //本地(测试)环境下的配置文件地址
|
|
|
const ProConfigFile = "config/config.yaml" //生产环境下的配置文件地址
|
|
|
+const DefaultFilePath = "config"
|
|
|
+const ConfigFilePath = "/home/code/config/eta_bridge/config" //生产环境下的配置文件地址
|
|
|
|
|
|
func init() {
|
|
|
v := viper.New()
|
|
|
|
|
|
- configFilePath := ConfigFile
|
|
|
+ configFilePath, _ := utils.ExistFiles(map[string][]string{
|
|
|
+ DefaultFilePath: {
|
|
|
+ ConfigFile,
|
|
|
+ ProConfigFile,
|
|
|
+ },
|
|
|
+ ConfigFilePath: {
|
|
|
+ ProConfigFile,
|
|
|
+ },
|
|
|
+ })
|
|
|
|
|
|
- //如果不存在该配置文件,那么应该是线上环境,那么去寻找线上配置文件的路径
|
|
|
- if !utils.FileIsExist(configFilePath) {
|
|
|
- configFilePath = ProConfigFile
|
|
|
- }
|
|
|
+ ////如果不存在该配置文件,那么应该是线上环境,那么去寻找线上配置文件的路径
|
|
|
+ //if !utils.FileIsExist(configFilePath) {
|
|
|
+ // configFilePath = ProConfigFile
|
|
|
+ //}
|
|
|
|
|
|
fmt.Println("configFilePath->", configFilePath)
|
|
|
|