Fix #153
This commit is contained in:
parent
18b6be23c1
commit
eac57d05ba
|
@ -265,12 +265,12 @@ func Save() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load loads the configurations from wide.json.
|
// Load loads the configurations from wide.json.
|
||||||
func Load() {
|
func Load(confPath string) {
|
||||||
bytes, _ := ioutil.ReadFile("conf/wide.json")
|
bytes, _ := ioutil.ReadFile(confPath)
|
||||||
|
|
||||||
err := json.Unmarshal(bytes, &Wide)
|
err := json.Unmarshal(bytes, &Wide)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Error(err)
|
glog.Error("Parses wide.json error: ", err)
|
||||||
|
|
||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
|
|
5
main.go
5
main.go
|
@ -40,6 +40,8 @@ import (
|
||||||
// The only one init function in Wide.
|
// The only one init function in Wide.
|
||||||
func init() {
|
func init() {
|
||||||
// TODO: args
|
// TODO: args
|
||||||
|
confPath := flag.String("conf", "conf/wide.json", "path of wide.json")
|
||||||
|
|
||||||
flag.Set("logtostderr", "true")
|
flag.Set("logtostderr", "true")
|
||||||
flag.Set("v", "3")
|
flag.Set("v", "3")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
@ -48,7 +50,8 @@ func init() {
|
||||||
|
|
||||||
event.Load()
|
event.Load()
|
||||||
|
|
||||||
conf.Load()
|
conf.Load(*confPath)
|
||||||
|
|
||||||
conf.FixedTimeCheckEnv()
|
conf.FixedTimeCheckEnv()
|
||||||
conf.FixedTimeSave()
|
conf.FixedTimeSave()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue