deprecated-oc-catalog/services/init.go

30 lines
453 B
Go
Raw Normal View History

2023-03-03 14:43:11 +01:00
package services
import (
"os"
"github.com/beego/beego/v2/core/logs"
beego "github.com/beego/beego/v2/server/web"
)
func Init() {
Discoveryinit() //First init DC name
var DBpoint string
var err error
2023-03-03 14:43:11 +01:00
DBpoint = os.Getenv("DOCKER_DBPOINT")
if len(DBpoint) == 0 {
DBpoint, err = beego.AppConfig.String("DBPOINT")
if err != nil {
logs.Critical("DBPOINT URI error: %v", err)
panic(err)
}
}
Mongoinit(DC_NAME + "-" + DBpoint)
}