rawlinp commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup URL: https://github.com/apache/incubator-trafficcontrol/pull/2029#discussion_r191002483
########## File path: traffic_ops/traffic_ops_golang/crconfig/edgelocations.go ########## @@ -57,6 +57,36 @@ and (st.name = 'REPORTED' or st.name = 'ONLINE' or st.name = 'ADMIN_DOWN') if ttype == RouterTypeName { routerLocs[cachegroup] = latlon } else { + primaryCacheId := "" + if err := db.QueryRow(`select id from cachegroup where name = $1`, cachegroup).Scan(&primaryCacheId); err != nil { + return nil, nil, errors.New("Failed while retrieving from cachegroup: " + err.Error()) + } + + dbRows, err := db.Query(`select backup_cg from cachegroup_fallbacks where primary_cg = $1 order by set_order`, primaryCacheId) + + if err != nil { + return nil, nil, errors.New("Error retrieving from cachegroup_fallbacks: " + err.Error()) + } + defer dbRows.Close() + + index := 0 + for dbRows.Next() { + backup_id := "" Review comment: in golang the typical naming style is to use camelcase, i.e. `backupID` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services