This commit is contained in:
Liang Ding 2014-11-16 22:25:27 +08:00
parent 18b6be23c1
commit eac57d05ba
2 changed files with 7 additions and 4 deletions

View File

@ -265,12 +265,12 @@ func Save() bool {
}
// Load loads the configurations from wide.json.
func Load() {
bytes, _ := ioutil.ReadFile("conf/wide.json")
func Load(confPath string) {
bytes, _ := ioutil.ReadFile(confPath)
err := json.Unmarshal(bytes, &Wide)
if err != nil {
glog.Error(err)
glog.Error("Parses wide.json error: ", err)
os.Exit(-1)
}

View File

@ -40,6 +40,8 @@ import (
// The only one init function in Wide.
func init() {
// TODO: args
confPath := flag.String("conf", "conf/wide.json", "path of wide.json")
flag.Set("logtostderr", "true")
flag.Set("v", "3")
flag.Parse()
@ -48,7 +50,8 @@ func init() {
event.Load()
conf.Load()
conf.Load(*confPath)
conf.FixedTimeCheckEnv()
conf.FixedTimeSave()