mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-09 05:39:08 -07:00
Begin refactor to better encapsulate configuration
This also updates the example_config.json which did not previously work. Config.Config is now composed of embedded structs of other configs that can later be used to clearly have a separation of concerns.
This commit is contained in:
@@ -116,7 +116,7 @@ func Serve(cfg *config.Config, tkr *tracker.Tracker) {
|
||||
tracker: tkr,
|
||||
}
|
||||
|
||||
glog.V(0).Info("Starting on ", cfg.Addr)
|
||||
glog.V(0).Info("Starting on ", cfg.ListenAddr)
|
||||
if cfg.HttpListenLimit != 0 {
|
||||
glog.V(0).Info("Limiting connections to ", cfg.HttpListenLimit)
|
||||
}
|
||||
@@ -126,7 +126,7 @@ func Serve(cfg *config.Config, tkr *tracker.Tracker) {
|
||||
ConnState: srv.connState,
|
||||
ListenLimit: cfg.HttpListenLimit,
|
||||
Server: &http.Server{
|
||||
Addr: cfg.Addr,
|
||||
Addr: cfg.ListenAddr,
|
||||
Handler: newRouter(srv),
|
||||
ReadTimeout: cfg.HttpReadTimeout.Duration,
|
||||
WriteTimeout: cfg.HttpWriteTimeout.Duration,
|
||||
|
||||
Reference in New Issue
Block a user