Skip to content
Snippets Groups Projects
Unverified Commit f2ed194a authored by Ian Chen's avatar Ian Chen Committed by GitHub
Browse files

Merge pull request #79 from yccodr/billing-disable

Disable Billing Server If Needed
parents c5938bf9 f47d82ef
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,7 @@ type Tls struct {
}
type BillingServer struct {
Enable bool `yaml:"enable" valid:"type(bool), default(true)"`
HostIPv4 string `yaml:"hostIPv4,omitempty" valid:"required,host"`
Port int `yaml:"port,omitempty" valid:"optional,port"`
ListenPort int `yaml:"listenPort,omitempty" valid:"required,port"`
......
......@@ -77,6 +77,7 @@ func (a *WebuiApp) Start(tlsKeyLogPath string) {
// get config file info from WebUIConfig
mongodb := factory.WebuiConfig.Configuration.Mongodb
webServer := factory.WebuiConfig.Configuration.WebServer
billingServer := factory.WebuiConfig.Configuration.BillingServer
// Connect to MongoDB
if err := mongoapi.SetMongoDB(mongodb.Name, mongodb.Url); err != nil {
......@@ -135,11 +136,13 @@ func (a *WebuiApp) Start(tlsKeyLogPath string) {
self.UpdateNfProfiles()
wg := sync.WaitGroup{}
wg.Add(1)
self.BillingServer = billing.OpenServer(&wg)
if self.BillingServer == nil {
logger.InitLog.Errorln("Billing Server open error.")
if billingServer.Enable {
wg.Add(1)
self.BillingServer = billing.OpenServer(&wg)
if self.BillingServer == nil {
logger.InitLog.Errorln("Billing Server open error.")
}
}
router.NoRoute(ReturnPublic())
......
......@@ -12,6 +12,7 @@ configuration:
ipv4Address: 0.0.0.0
port: 5000
billingServer:
enable: true
hostIPv4: 127.0.0.1
listenPort: 2122
port: 2121
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment