You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/03/10 16:25:00 UTC

[GitHub] [trafficcontrol] srijeet0406 commented on a change in pull request #6633: Fix TO to use DB port from config

srijeet0406 commented on a change in pull request #6633:
URL: https://github.com/apache/trafficcontrol/pull/6633#discussion_r823910463



##########
File path: traffic_ops/traffic_ops_golang/config/config.go
##########
@@ -317,6 +323,9 @@ func LoadConfig(cdnConfPath string, dbConfPath string, appVersion string) (Confi
 	if err != nil {
 		return Config{}, []error{fmt.Errorf("unmarshalling '%s': %v", dbConfPath, err)}, BlockStartup
 	}
+	if portNum, err := strconv.Atoi(cfg.DB.Port); err != nil || portNum < MinPort || MaxPort < portNum {
+		cfg.DB.Port = DefaultDBPort

Review comment:
       Do you think we should print an error here, saying that the port in the config file was invalid, so we're defaulting to 5432?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org