Skip to content

Commit

Permalink
fix: use repo config on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
alok committed Dec 4, 2021
1 parent afdbe7a commit 0c60fbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/diag/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func New(
}

func RegisterHTTP(m Manager, mux *http.ServeMux) {
mux.HandleFunc("/v1/status", func(w http.ResponseWriter, r *http.Request) {
mux.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) {
buf, err := json.MarshalIndent(m.Status(), "", "\t")
if err != nil {
http.Error(w, "Failed to get status Err:"+err.Error(),
Expand Down
7 changes: 7 additions & 0 deletions modules/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ func New(bCfg config.Config) (core.Service, error) {
return nil, err
}
}

// if the repo was initialized, the passed config has been saved in it and hence
// it should return the same values. if the repo was already initialized, this
// would get the saved config. This allows for node to be started with just the
// root path
bCfg = r.Config()

svc := &impl{}

var tmCfg map[string]int
Expand Down

0 comments on commit 0c60fbe

Please sign in to comment.