Skip to content

Commit

Permalink
Improve config generation
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Jan 7, 2020
1 parent b4ceaef commit f195e42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/visor/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type Config struct {
Routing struct {
SetupNodes []cipher.PubKey `json:"setup_nodes"`
RouteFinder string `json:"route_finder"`
RouteFinderTimeout Duration `json:"route_finder_timeout"`
RouteFinderTimeout Duration `json:"route_finder_timeout,omitempty"`
} `json:"routing"`

Uptime struct {
Expand All @@ -68,13 +68,13 @@ type Config struct {
LocalPath string `json:"local_path"`

LogLevel string `json:"log_level"`
ShutdownTimeout Duration `json:"shutdown_timeout"` // time value, examples: 10s, 1m, etc
ShutdownTimeout Duration `json:"shutdown_timeout,omitempty"` // time value, examples: 10s, 1m, etc

Interfaces InterfaceConfig `json:"interfaces"`

AppServerSockFile string `json:"app_server_sock_file"`

RestartCheckDelay string `json:"restart_check_delay"`
RestartCheckDelay string `json:"restart_check_delay,omitempty"`
}

// MessagingConfig returns config for dmsg client.
Expand Down
2 changes: 1 addition & 1 deletion pkg/visor/visor.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ func (node *Node) writeConfig(config *Config) error {

node.logger.Infof("Updating visor config to %+v", config)

bytes, err := json.Marshal(config)
bytes, err := json.MarshalIndent(config, "", "\t")
if err != nil {
return err
}
Expand Down

0 comments on commit f195e42

Please sign in to comment.