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 2020/11/19 23:10:32 UTC

[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5312: Removing atscfg as a dependency in traffic_ops_golang

zrhoffman commented on a change in pull request #5312:
URL: https://github.com/apache/trafficcontrol/pull/5312#discussion_r527250619



##########
File path: traffic_ops/traffic_ops_golang/server/servers_assignment.go
##########
@@ -57,6 +56,15 @@ FROM deliveryservice
 LEFT OUTER JOIN cdn ON cdn.id=deliveryservice.cdn_id
 WHERE deliveryservice.id = ANY($1)
 `
+const RemapFile = "remap.config"
+const ConfigSuffix = ".config"
+const RegexRemapPrefix = "regex_remap_"
+const CacheUrlPrefix = "cacheurl_"
+const HeaderRewritePrefix = "hdr_rw_"

Review comment:
       These can all be function-level constants, right?

##########
File path: traffic_ops/traffic_ops_golang/server/servers_assignment.go
##########
@@ -269,7 +277,9 @@ INSERT INTO deliveryservice_server (deliveryservice, server)
 
 	//need remap config location
 	var atsConfigLocation string
-	if err := tx.QueryRow("SELECT value FROM parameter WHERE name = 'location' AND config_file = '" + atscfg.RemapFile + "'").Scan(&atsConfigLocation); err != nil {
+	if err := tx.QueryRow("SELECT value FROM parameter " +
+		"WHERE name = 'location'" +
+		" AND config_file = '" + RemapFile + "'").Scan(&atsConfigLocation); err != nil {

Review comment:
       Nit: If this is going to be a multi-line string, you can use backticks instead of double quotes to remove 2 concatenations.




----------------------------------------------------------------
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.

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